Skip to content

Commit

Permalink
Disable delay before onAppReady() by default
Browse files Browse the repository at this point in the history
  • Loading branch information
oza6ut0ne committed May 15, 2024
1 parent 1f9199d commit 02d12cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface ConfigSchema {
readonly roundIconEnabled: boolean;
readonly frameRateLimitEnabled: boolean;
readonly hardwareAccelerationEnabled: boolean;
readonly onAppReadyDelay: number;
readonly globalRestoreAccelerator: string;
}

Expand Down Expand Up @@ -86,6 +87,7 @@ class Config {
roundIconEnabled: false,
frameRateLimitEnabled: true,
hardwareAccelerationEnabled: false,
onAppReadyDelay: 0,
globalRestoreAccelerator: 'CmdOrCtrl+Shift+Space'
};

Expand Down Expand Up @@ -245,6 +247,10 @@ class Config {
this.store.set(getVarName(() => this.defaultValues.hardwareAccelerationEnabled), value);
}

get onAppReadyDelay(): number {
return this.store.get(getVarName(() => this.defaultValues.onAppReadyDelay));
}

get globalRestoreAccelerator(): string {
return this.store.get(getVarName(() => this.defaultValues.globalRestoreAccelerator));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (!config.hardwareAccelerationEnabled) {
if (!config.frameRateLimitEnabled) {
app.commandLine.appendSwitch('disable-frame-rate-limit');
}
app.whenReady().then(() => setTimeout(onAppReady, 2000));
app.whenReady().then(() => setTimeout(onAppReady, config.onAppReadyDelay));
app.on('window-all-closed', app.quit);

function onAppReady() {
Expand Down

0 comments on commit 02d12cd

Please sign in to comment.