1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-01 08:03:20 +00:00

reload callback

This commit is contained in:
Kyle Spearrin
2019-02-25 16:14:54 -05:00
parent 9a4611ec5a
commit 79c15a1841

View File

@@ -20,7 +20,7 @@ export class LockService implements LockServiceAbstraction {
private collectionService: CollectionService, private cryptoService: CryptoService,
private platformUtilsService: PlatformUtilsService, private storageService: StorageService,
private messagingService: MessagingService, private searchService: SearchService,
private lockedCallback: () => Promise<void>) {
private lockedCallback: () => Promise<void> = null, private reloadCallback: () => Promise<void> = null) {
}
init(checkOnInterval: boolean) {
@@ -49,7 +49,7 @@ export class LockService implements LockServiceAbstraction {
return;
}
if (this.isLocked()) {
if (await this.isLocked()) {
return;
}
@@ -135,6 +135,9 @@ export class LockService implements LockServiceAbstraction {
clearInterval(this.reloadInterval);
this.reloadInterval = null;
this.messagingService.send('reloadProcess');
if (this.reloadCallback != null) {
await this.reloadCallback();
}
}
}, 10000);
}