mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-10 13:09:37 +01:00
fix errors when unlocking. exclude restart lock option from lockout timer
This commit is contained in:
parent
b0135cdf03
commit
10bc4f7e5d
@ -26,12 +26,23 @@ chrome.commands.onCommand.addListener(function (command) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var loadMenuRan = false;
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
if (msg.command === 'loggedOut' || msg.command === 'loggedIn' || msg.command === 'unlocked' || msg.command === 'locked') {
|
if (msg.command === 'loggedOut' || msg.command === 'loggedIn' || msg.command === 'unlocked' || msg.command === 'locked') {
|
||||||
|
if (loadMenuRan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadMenuRan = true;
|
||||||
|
|
||||||
setIcon();
|
setIcon();
|
||||||
refreshBadgeAndMenu();
|
refreshBadgeAndMenu();
|
||||||
}
|
}
|
||||||
else if (msg.command === 'syncCompleted' && msg.successfully) {
|
else if (msg.command === 'syncCompleted' && msg.successfully) {
|
||||||
|
if (loadMenuRan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadMenuRan = true;
|
||||||
|
|
||||||
setTimeout(refreshBadgeAndMenu, 2000);
|
setTimeout(refreshBadgeAndMenu, 2000);
|
||||||
}
|
}
|
||||||
else if (msg.command === 'bgOpenOverlayPopup') {
|
else if (msg.command === 'bgOpenOverlayPopup') {
|
||||||
@ -148,7 +159,7 @@ function refreshBadgeAndMenu() {
|
|||||||
|
|
||||||
buildContextMenu(function () {
|
buildContextMenu(function () {
|
||||||
loadMenuAndUpdateBadge(tab.url, tab.id, true);
|
loadMenuAndUpdateBadge(tab.url, tab.id, true);
|
||||||
onUpdatedRan = onReplacedRan = false;
|
onUpdatedRan = onReplacedRan = loadMenuRan = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -431,7 +442,8 @@ function checkLock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
chrome.storage.local.get(constantsService.lockOptionKey, function (obj) {
|
chrome.storage.local.get(constantsService.lockOptionKey, function (obj) {
|
||||||
if (obj && !obj[constantsService.lockOptionKey] && obj[constantsService.lockOptionKey] !== 0) {
|
if (obj && ((!obj[constantsService.lockOptionKey] && obj[constantsService.lockOptionKey] !== 0) ||
|
||||||
|
obj[constantsService.lockOptionKey] === -1)) {
|
||||||
// no lock option set
|
// no lock option set
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user