mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 08:17:10 +08: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() {
|
export async function initAndShowMainWindow() {
|
||||||
if (!browserWindow || (await browserWindow.then(w => w.isDestroyed()))) {
|
if (!browserWindow || (await browserWindow.then(w => w.isDestroyed()))) {
|
||||||
const additionalArguments = await getWindowAdditionalArguments();
|
browserWindow = (async () => {
|
||||||
browserWindow = createWindow(additionalArguments);
|
const additionalArguments = await getWindowAdditionalArguments();
|
||||||
|
return createWindow(additionalArguments);
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
const mainWindow = await browserWindow;
|
const mainWindow = await browserWindow;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user