mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user