fix(electron): optimize electron open/close on mac (#6224)
1. never close main window on mac to allow it to be quickly open 1. make the browser show a bit faster 2. brought up app window when clicking some menu items
This commit is contained in:
5 files changed
+67
-24
No files matched your search
@@ -4,7 +4,7 @@ import { getLinkPreview } from 'link-preview-js';
|
||||
import { isMacOS } from '../../shared/utils';
|
||||
import { persistentConfig } from '../config-storage/persist';
|
||||
import { logger } from '../logger';
|
||||
import { getMainWindow, initMainWindow } from '../main-window';
|
||||
import { getMainWindow, initAndShowMainWindow } from '../main-window';
|
||||
import { getOnboardingWindow } from '../onboarding';
|
||||
import type { NamespaceHandlers } from '../type';
|
||||
import { launchStage } from '../windows-manager/stage';
|
||||
@@ -58,7 +58,7 @@ export const uiHandlers = {
|
||||
try {
|
||||
const onboarding = await getOnboardingWindow();
|
||||
onboarding?.hide();
|
||||
await initMainWindow();
|
||||
await initAndShowMainWindow();
|
||||
// need to destroy onboarding window after main window is ready
|
||||
// otherwise the main window will be closed as well
|
||||
onboarding?.destroy();
|
||||
|
||||
Reference in new issue
Block a user