1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

added lock now option

This commit is contained in:
Kyle Spearrin
2017-06-13 11:53:08 -04:00
parent 4861aa0210
commit e079b70e6a
5 changed files with 29 additions and 8 deletions

View File

@@ -50,7 +50,7 @@ function initLockService(self) {
var diffSeconds = ((new Date()).getTime() - lastActive) / 1000;
if (diffSeconds >= lockOptionSeconds) {
// need to lock now
self.lock();
return self.lock();
}
});
}
@@ -59,16 +59,18 @@ function initLockService(self) {
chrome.idle.onStateChanged.addListener(function (newState) {
if (newState === 'locked') {
getLockOption().then(function (lockOption) {
if (lockOption === -2) {
self.lock();
if (lockOption !== -2) {
return;
}
return self.lock();
});
}
});
}
LockService.prototype.lock = function () {
Q.all([
return Q.all([
self.cryptoService.clearKey(),
self.cryptoService.clearOrgKeys(true),
self.cryptoService.clearPrivateKey(true)