|
@@ -41,14 +41,14 @@ ipcMain.handle('bootstrap', (event) => {
|
|
|
return isTrustedSender(event.sender) ? electronPath : null;
|
|
|
});
|
|
|
|
|
|
-async function createWindow () {
|
|
|
+async function createWindow (backgroundColor?: string) {
|
|
|
await app.whenReady();
|
|
|
|
|
|
const options: Electron.BrowserWindowConstructorOptions = {
|
|
|
width: 960,
|
|
|
height: 620,
|
|
|
autoHideMenuBar: true,
|
|
|
- backgroundColor: '#2f3241',
|
|
|
+ backgroundColor,
|
|
|
webPreferences: {
|
|
|
preload: path.resolve(__dirname, 'preload.js'),
|
|
|
contextIsolation: true,
|
|
@@ -95,7 +95,7 @@ export const loadURL = async (appUrl: string) => {
|
|
|
};
|
|
|
|
|
|
export const loadFile = async (appPath: string) => {
|
|
|
- mainWindow = await createWindow();
|
|
|
+ mainWindow = await createWindow(appPath === 'index.html' ? '#2f3241' : undefined);
|
|
|
mainWindow.loadFile(appPath);
|
|
|
mainWindow.focus();
|
|
|
};
|