mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Typescript - Fix bound changes issue (#660)
This commit is contained in:
committed by
Vishwas Shashidhar
parent
e094aa7fff
commit
2743d1ba96
@@ -70,8 +70,8 @@ export interface INotificationSetting {
|
||||
}
|
||||
|
||||
export interface ICustomRectangle extends Partial<Electron.Rectangle> {
|
||||
isMaximized: boolean;
|
||||
isFullScreen: boolean;
|
||||
isMaximized?: boolean;
|
||||
isFullScreen?: boolean;
|
||||
}
|
||||
|
||||
class Config {
|
||||
|
@@ -7,7 +7,7 @@ import { config } from './config-handler';
|
||||
import { ICustomBrowserWindow, windowHandler } from './window-handler';
|
||||
import { showPopupMenu, windowExists } from './window-utils';
|
||||
|
||||
const saveWindowSettings = (): void => {
|
||||
const saveWindowSettings = async (): Promise<void> => {
|
||||
const browserWindow = BrowserWindow.getFocusedWindow() as ICustomBrowserWindow;
|
||||
|
||||
if (browserWindow && !browserWindow.isDestroyed()) {
|
||||
@@ -15,6 +15,11 @@ const saveWindowSettings = (): void => {
|
||||
const [ width, height ] = browserWindow.getSize();
|
||||
if (x && y && width && height) {
|
||||
browserWindow.webContents.send('boundsChange', { x, y, width, height, windowName: browserWindow.winName } as IBoundsChange);
|
||||
|
||||
// Update the config file
|
||||
if (browserWindow.winName === apiName.mainWindowName) {
|
||||
await config.updateUserConfig({ mainWinPos: { x, y, width, height } });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user