fix: only set backgroundColor in default-app for default index.html (#28792)
This commit is contained in:
parent
7c32deb70f
commit
ae0de8ef9f
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue