[MM-51871] Migrate mainWindow and settingsWindow to singletons (#2650)
* Migrate mainWindow to singleton * Migrate settingsWindow to singleton * PR feedback * Missed a couple unwrapping cases
This commit is contained in:
@@ -28,6 +28,7 @@ import {createMenu as createTrayMenu} from 'main/menus/tray';
|
||||
import {ServerInfo} from 'main/server/serverInfo';
|
||||
import {setTrayMenu} from 'main/tray/tray';
|
||||
import WindowManager from 'main/windows/windowManager';
|
||||
import MainWindow from 'main/windows/mainWindow';
|
||||
|
||||
import {mainProtocol} from './initialize';
|
||||
|
||||
@@ -140,7 +141,7 @@ export function wasUpdated(lastAppVersion?: string) {
|
||||
|
||||
export function clearAppCache() {
|
||||
// TODO: clear cache on browserviews, not in the renderer.
|
||||
const mainWindow = WindowManager.getMainWindow();
|
||||
const mainWindow = MainWindow.get();
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.session.clearCache().then(mainWindow.reload);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user