mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
fix(electron): possible issue on openning two main windows (#6307)
fix https://github.com/toeverything/AFFiNE/issues/6303 fetching `getWindowAdditionalArguments` requires forking a new process & handshake, which could be time consuming
This commit is contained in:
@@ -183,8 +183,10 @@ let hiddenMacWindow: BrowserWindow | undefined;
|
||||
*/
|
||||
export async function initAndShowMainWindow() {
|
||||
if (!browserWindow || (await browserWindow.then(w => w.isDestroyed()))) {
|
||||
const additionalArguments = await getWindowAdditionalArguments();
|
||||
browserWindow = createWindow(additionalArguments);
|
||||
browserWindow = (async () => {
|
||||
const additionalArguments = await getWindowAdditionalArguments();
|
||||
return createWindow(additionalArguments);
|
||||
})();
|
||||
}
|
||||
const mainWindow = await browserWindow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user