1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-25 16:59:17 +01:00

allow static lock timeout definition

This commit is contained in:
Kyle Spearrin 2018-06-09 14:50:18 -04:00
parent 7b05416d55
commit cd3c2ddff1
3 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -103,6 +103,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return false;
}
lockTimeout(): number {
return null;
}
launchUri(uri: string, options?: any): void {
shell.openExternal(uri);
}

View File

@ -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;
}