Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
allow static lock timeout definition
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Jun 9, 2018
1 parent 7b05416 commit cd3c2dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/abstractions/platformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export abstract class PlatformUtilsService {
analyticsId: () => string;
getDomain: (uriString: string) => string;
isViewOpen: () => boolean;
lockTimeout: () => number;
launchUri: (uri: string, options?: any) => void;
saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;
getApplicationVersion: () => string;
Expand Down
4 changes: 4 additions & 0 deletions src/electron/services/electronPlatformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return false;
}

lockTimeout(): number {
return null;
}

launchUri(uri: string, options?: any): void {
shell.openExternal(uri);
}
Expand Down
5 changes: 4 additions & 1 deletion src/services/lock.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export class LockService implements LockServiceAbstraction {
return;
}

const lockOption = await this.storageService.get<number>(ConstantsService.lockOptionKey);
let lockOption = this.platformUtilsService.lockTimeout();
if (lockOption == null) {
lockOption = await this.storageService.get<number>(ConstantsService.lockOptionKey);
}
if (lockOption == null || lockOption < 0) {
return;
}
Expand Down

0 comments on commit cd3c2dd

Please sign in to comment.