-
Notifications
You must be signed in to change notification settings - Fork 251
Settings refactor #541
Settings refactor #541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still a related issue with Anki template preview that I noticed when doing #539. If you change result grouping mode, the object used to generate the preview isn't updated before you reload the settings page or edit the preview text. Maybe not in scope for this PR unless it reveals other issues that should be fixed.
@@ -265,6 +250,9 @@ async function onOptionsUpdated({source}) { | |||
|
|||
const optionsContext = getOptionsContext(); | |||
const options = await getOptionsMutable(optionsContext); | |||
|
|||
onAnkiOptionsChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await
@@ -260,6 +259,7 @@ async function onOptionsUpdated({source}) { | |||
const options = await getOptionsMutable(optionsContext); | |||
|
|||
document.querySelector('#enable-clipboard-popups').checked = options.general.enableClipboardPopups; | |||
ankiTemplatesUpdateValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not await
on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all the awaits are omitted because they are unnecessary. The anki settings are modified independently, so there is no reason to await.
In general, most of the files in the settings folder need to be refactored. I am trying to do incremental changes to get to that point. The layout/design changes for the updated settings page also necessitate some changes. So tasks like that will probably be addressed during those changes. |
Cleans up a few things in preparation for some larger refactoring and changes.
general.enableClipboardPopups
handling.