mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 03:31:56 +00:00
main: Remove mainWindowState from globals.
(No, globals are not accessible from the other process.) Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -13,11 +13,7 @@ import * as CertificateUtil from '../renderer/js/utils/certificate-util';
|
||||
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||
import * as ProxyUtil from '../renderer/js/utils/proxy-util';
|
||||
|
||||
interface PatchedGlobal extends NodeJS.Global {
|
||||
mainWindowState: windowStateKeeper.State;
|
||||
}
|
||||
|
||||
const globalPatched = global as PatchedGlobal;
|
||||
let mainWindowState: windowStateKeeper.State;
|
||||
|
||||
// Prevent window being garbage collected
|
||||
let mainWindow: Electron.BrowserWindow;
|
||||
@@ -77,9 +73,6 @@ function createMainWindow(): Electron.BrowserWindow {
|
||||
path: `${app.getPath('userData')}/config`
|
||||
});
|
||||
|
||||
// Let's keep the window position global so that we can access it in other process
|
||||
globalPatched.mainWindowState = mainWindowState;
|
||||
|
||||
const win = new electron.BrowserWindow({
|
||||
// This settings needs to be saved in config
|
||||
title: 'Zulip',
|
||||
@@ -315,7 +308,7 @@ ${error}`
|
||||
});
|
||||
|
||||
ipcMain.on('clear-app-settings', () => {
|
||||
globalPatched.mainWindowState.unmanage();
|
||||
mainWindowState.unmanage();
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
});
|
||||
|
Reference in New Issue
Block a user