mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-22 18:30:09 +00:00
fix(electron): minimize to tray not working immediately after enabling
Closes #5622 The 'Minimize to tray' setting was not updating the main process shared state when changed in the settings, requiring an app restart to take effect. This was because the 'UPDATE_SETTINGS' IPC event (sent on change) was not updating the 'isMinimizeToTray' flag. This commit ensures that 'UPDATE_SETTINGS' updates the relevant shared state.
This commit is contained in:
parent
c2ba004e2f
commit
e19d3fb593
1 changed files with 5 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ export const initAppControlIpc = (): void => {
|
|||
ipcMain.on(IPC.OPEN_DEV_TOOLS, () => getWin().webContents.openDevTools());
|
||||
ipcMain.on(IPC.RELOAD_MAIN_WIN, () => getWin().reload());
|
||||
|
||||
ipcMain.on(IPC.TRANSFER_SETTINGS_TO_ELECTRON, async (ev, cfg: GlobalConfigState) => {
|
||||
const updateSettings = async (ev: any, cfg: GlobalConfigState): Promise<void> => {
|
||||
setIsMinimizeToTray(cfg.misc.isMinimizeToTray);
|
||||
setIsTrayShowCurrentTask(cfg.misc.isTrayShowCurrentTask);
|
||||
setIsTrayShowCurrentCountdown(cfg.misc.isTrayShowCurrentCountdown);
|
||||
|
|
@ -32,7 +32,10 @@ export const initAppControlIpc = (): void => {
|
|||
cfg.misc.isUseCustomWindowTitleBar,
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ipcMain.on(IPC.TRANSFER_SETTINGS_TO_ELECTRON, updateSettings);
|
||||
ipcMain.on(IPC.UPDATE_SETTINGS, updateSettings);
|
||||
|
||||
ipcMain.on(IPC.SHOW_OR_FOCUS, () => {
|
||||
const mainWin = getWin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue