-
Notifications
You must be signed in to change notification settings - Fork 748
Closed
Labels
🪲 bugSomething isn't workingSomething isn't workingarea:settingsgood first issueGood for newcomersGood for newcomers
Description
If you have multiple windows open, updating a setting in one window is not reflected in the other windows. Came across this when I updated my GitHub PAT in one window and it wasn't used in the others.
Most visible repro case would be to change the theme in one window and observe that other windows remain on the previous theme.
Suggested plan of attack based off of some brief consideration (alternatives welcome):
- Add an
enum SettingKeytosrc/interfaces.tswhich lists all keys used to store settings inlocalStorage - Update all usages of
localStorage.getItem/localStorage.setItemto use those enum values - In
AppState.save, send an IPC event to main process, e.g.window.ElectronFiddle.settingsChanged() - In main process, listen for that IPC event, then broadcast a "refresh-settings" event to all windows except the sender
- In
AppStateconstructor, listen for that event (window.ElectronFiddle.addEventListener('refresh-settings', ...)) and loop through the enum keys, with a switch statement for key values and retrieve the latest value fromlocalStorageand update the state accordingly for that setting
That should ensure exhaustiveness checking for the persisted settings to ensure we don't miss any during future changes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🪲 bugSomething isn't workingSomething isn't workingarea:settingsgood first issueGood for newcomersGood for newcomers