mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-24 18:00:28 -06:00
SDA-3726 - Use separate logic to update the window maximized state (#1433)
This commit is contained in:
parent
17edd19a71
commit
a2453c27e4
@ -85,8 +85,23 @@ const saveWindowSettings = async (): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
const windowMaximized = async (): Promise<void> => {
|
||||
const browserWindow = BrowserWindow.getFocusedWindow() as ICustomBrowserWindow;
|
||||
if (browserWindow && windowExists(browserWindow)) {
|
||||
const isMaximized = browserWindow.isMaximized();
|
||||
const isFullScreen = browserWindow.isFullScreen();
|
||||
if (browserWindow.winName === apiName.mainWindowName) {
|
||||
const { mainWinPos } = config.getUserConfigFields(['mainWinPos']);
|
||||
await config.updateUserConfig({
|
||||
mainWinPos: { ...mainWinPos, ...{ isMaximized, isFullScreen } },
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const throttledWindowChanges = throttle(async (eventName, window) => {
|
||||
await saveWindowSettings();
|
||||
await windowMaximized();
|
||||
notification.moveNotificationToTop();
|
||||
if (
|
||||
window &&
|
||||
|
Loading…
Reference in New Issue
Block a user