mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-23 04:52:02 -08:00
fix: delay 500ms for window menu, which won't be use in start, but will require CPU resources. And if not in settimeout, getting service itself from ioc container will cause infinite loop. Causing RangeError: Maximum call stack size exceededException in PromiseRejectCallback
This commit is contained in:
parent
5093da125f
commit
3deaa14b7a
6 changed files with 145 additions and 120 deletions
|
|
@ -25,6 +25,7 @@ import type { IWindowService } from '@services/windows/interface';
|
|||
import { WindowNames } from '@services/windows/WindowProperties';
|
||||
import type { IWorkspace, IWorkspaceService } from '@services/workspaces/interface';
|
||||
|
||||
import { DELAY_MENU_REGISTER } from '@/constants/parameters';
|
||||
import type { IInitializeWorkspaceOptions, IWorkspaceViewService } from './interface';
|
||||
import { registerMenu } from './registerMenu';
|
||||
|
||||
|
|
@ -64,7 +65,9 @@ export class WorkspaceView implements IWorkspaceViewService {
|
|||
private readonly nativeService!: INativeService;
|
||||
|
||||
constructor() {
|
||||
void registerMenu();
|
||||
setTimeout(() => {
|
||||
void registerMenu();
|
||||
}, DELAY_MENU_REGISTER);
|
||||
}
|
||||
|
||||
public async initializeAllWorkspaceView(): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue