remove loadMenuRan check since we should be covered by other checks going forward
This commit is contained in:
parent
8dbb2ece42
commit
c2c65baadb
|
@ -28,39 +28,23 @@ chrome.commands.onCommand.addListener(function (command) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var loadMenuRan = false,
|
var loginToAutoFill = null,
|
||||||
loginToAutoFill = null,
|
|
||||||
pageDetailsToAutoFill = [],
|
pageDetailsToAutoFill = [],
|
||||||
autofillTimeout = null,
|
autofillTimeout = null,
|
||||||
menuOptionsLoaded = [];
|
menuOptionsLoaded = [];
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
if (msg.command === 'loggedIn' || msg.command === 'unlocked' || msg.command === 'locked') {
|
if (msg.command === 'loggedIn' || msg.command === 'unlocked' || msg.command === 'locked') {
|
||||||
if (loadMenuRan) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loadMenuRan = true;
|
|
||||||
|
|
||||||
setIcon();
|
setIcon();
|
||||||
refreshBadgeAndMenu();
|
refreshBadgeAndMenu();
|
||||||
}
|
}
|
||||||
else if (msg.command === 'logout') {
|
else if (msg.command === 'logout') {
|
||||||
logout(msg.expired, function () {
|
logout(msg.expired, function () {
|
||||||
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') {
|
||||||
|
@ -88,7 +72,6 @@ chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
saveAddLogin(sender.tab);
|
saveAddLogin(sender.tab);
|
||||||
}
|
}
|
||||||
else if (msg.command === 'collectPageDetailsResponse') {
|
else if (msg.command === 'collectPageDetailsResponse') {
|
||||||
// messageCurrentTab('openNotificationBar', { type: 'add', typeData: null });
|
|
||||||
if (msg.contentScript) {
|
if (msg.contentScript) {
|
||||||
var forms = autofillService.getFormsWithPasswordFields(msg.details);
|
var forms = autofillService.getFormsWithPasswordFields(msg.details);
|
||||||
messageTab(msg.tabId, 'pageDetails', { details: msg.details, forms: forms });
|
messageTab(msg.tabId, 'pageDetails', { details: msg.details, forms: forms });
|
||||||
|
@ -250,7 +233,7 @@ function refreshBadgeAndMenu() {
|
||||||
|
|
||||||
buildContextMenu(function () {
|
buildContextMenu(function () {
|
||||||
loadMenuAndUpdateBadge(tab.url, tab.id, true);
|
loadMenuAndUpdateBadge(tab.url, tab.id, true);
|
||||||
onUpdatedRan = onReplacedRan = loadMenuRan = false;
|
onUpdatedRan = onReplacedRan = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue