mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-3726 - Use separate logic to update the window maximized state (#1433)
This commit is contained in:
@@ -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) => {
|
const throttledWindowChanges = throttle(async (eventName, window) => {
|
||||||
await saveWindowSettings();
|
await saveWindowSettings();
|
||||||
|
await windowMaximized();
|
||||||
notification.moveNotificationToTop();
|
notification.moveNotificationToTop();
|
||||||
if (
|
if (
|
||||||
window &&
|
window &&
|
||||||
|
|||||||
Reference in New Issue
Block a user