Skip to content

Commit

Permalink
app: Use deep observe to save config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Nov 19, 2020
1 parent 89854c2 commit 80dc62c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shared/store/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ export const registerMainIpc = () => {
});

// Register listener for config object changes
ipcMain.on('config-update', (_e, change: SerializedChange) => {
applyStoreChange(change);
settings.set(serialize(AppConfig, store.config));
});
ipcMain.on('config-update', (_e, change: SerializedChange) => applyStoreChange(change));

// Save any updates to the configuration store
deepObserve(store.config, () => settings.set(serialize(AppConfig, store.config)));
};

/**
Expand Down

0 comments on commit 80dc62c

Please sign in to comment.