fix(electron): main window should be opened first before destroying onboard window (#5319)

The issue listed on the title will prevent main window from showing on windows.
This commit is contained in:
Peng Xiao
2023-12-19 09:22:43 +00:00
parent e10609276d
commit 128f8066c3
8 changed files with 40 additions and 37 deletions
@@ -14,8 +14,6 @@ import { parseCookie } from './utils';
const IS_DEV: boolean =
process.env.NODE_ENV === 'development' && !process.env.CI;
const DEV_TOOL = process.env.DEV_TOOL === 'true';
// todo: not all window need all of the exposed meta
const getWindowAdditionalArguments = async () => {
const { getExposedMeta } = await import('./exposed');
@@ -25,6 +23,7 @@ const getWindowAdditionalArguments = async () => {
return [
`--main-exposed-meta=` + JSON.stringify(mainExposedMeta),
`--helper-exposed-meta=` + JSON.stringify(helperExposedMeta),
`--window-name=main`,
];
};
@@ -92,12 +91,6 @@ async function createWindow(additionalArguments: string[]) {
);
logger.info('main window is ready to show');
if (DEV_TOOL) {
browserWindow.webContents.openDevTools({
mode: 'detach',
});
}
});
browserWindow.on('close', e => {