Skip to content

Commit

Permalink
fix: only set backgroundColor in default-app for default index.html (#…
Browse files Browse the repository at this point in the history
…28841)

Co-authored-by: Milan Burda <milan.burda@gmail.com>
  • Loading branch information
trop[bot] and miniak committed Apr 26, 2021
1 parent 8995a6b commit 37d42ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions default_app/default_app.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -96,7 +96,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();
};

0 comments on commit 37d42ec

Please sign in to comment.