From ae0de8ef9f6c7f0c314fa05db5c2f80d664d7072 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 26 Apr 2021 09:29:14 +0200 Subject: [PATCH] fix: only set backgroundColor in default-app for default index.html (#28792) --- default_app/default_app.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/default_app/default_app.ts b/default_app/default_app.ts index 6fe7b11c128b..5e52422f1f30 100644 --- a/default_app/default_app.ts +++ b/default_app/default_app.ts @@ -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(); };