1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +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; analyticsId: () => string;
getDomain: (uriString: string) => string; getDomain: (uriString: string) => string;
isViewOpen: () => boolean; isViewOpen: () => boolean;
lockTimeout: () => number;
launchUri: (uri: string, options?: any) => void; launchUri: (uri: string, options?: any) => void;
saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void; saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;
getApplicationVersion: () => string; getApplicationVersion: () => string;

View File

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

View File

@ -42,7 +42,10 @@ export class LockService implements LockServiceAbstraction {
return; 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) { if (lockOption == null || lockOption < 0) {
return; return;
} }