fix: theme not being persisted issue (#2283)

This commit is contained in:
Peng Xiao
2023-05-10 11:04:36 +08:00
committed by GitHub
parent 87ffdad862
commit 0c550a2827
21 changed files with 359 additions and 278 deletions

View File

@@ -1,4 +1,4 @@
import { BrowserWindow, nativeTheme } from 'electron';
import { app, BrowserWindow, nativeTheme } from 'electron';
import { isMacOS } from '../../../../utils';
import type { NamespaceHandlers } from '../type';
@@ -17,6 +17,25 @@ export const uiHandlers = {
});
}
},
handleMinimizeApp: async () => {
const windows = BrowserWindow.getAllWindows();
windows.forEach(w => {
w.minimize();
});
},
handleMaximizeApp: async () => {
const windows = BrowserWindow.getAllWindows();
windows.forEach(w => {
if (w.isMaximized()) {
w.unmaximize();
} else {
w.maximize();
}
});
},
handleCloseApp: async () => {
app.quit();
},
getGoogleOauthCode: async () => {
return getGoogleOauthCode();
},