mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-26 12:10:25 +01:00
#1254 FIX no tab with id
This commit is contained in:
parent
f932c90b67
commit
eb36723fcc
@ -25,6 +25,8 @@
|
|||||||
"errorStorageCorruptedMessage": "We will try to fix it for you. Please wait.",
|
"errorStorageCorruptedMessage": "We will try to fix it for you. Please wait.",
|
||||||
"errorInactiveTabTitle": "Inactive tab",
|
"errorInactiveTabTitle": "Inactive tab",
|
||||||
"errorInactiveTabMessage": "Please refresh this tab to use the 2FAS Browser Extension.",
|
"errorInactiveTabMessage": "Please refresh this tab to use the 2FAS Browser Extension.",
|
||||||
|
"errorLackOfTabTitle": "Your tab has been closed",
|
||||||
|
"errorLackOfTabMessage": "The request will be ignored",
|
||||||
"warningTooSoonTitle": "Wait a moment",
|
"warningTooSoonTitle": "Wait a moment",
|
||||||
"warningTooSoonMessage": "Please wait DIFF seconds before sending another request.",
|
"warningTooSoonMessage": "Please wait DIFF seconds before sending another request.",
|
||||||
"warningSelectInputTitle": "Select the text field first",
|
"warningSelectInputTitle": "Select the text field first",
|
||||||
|
@ -44,6 +44,11 @@ const handleLoginRequest = (tabID, data) => {
|
|||||||
})
|
})
|
||||||
.then(() => closeRequest(tabID, data.token_request_id))
|
.then(() => closeRequest(tabID, data.token_request_id))
|
||||||
.catch(async err => {
|
.catch(async err => {
|
||||||
|
if (err.toString().includes('No tab with id')) {
|
||||||
|
return closeRequest(tabID, data.token_request_id)
|
||||||
|
.then(() => TwoFasNotification.show(config.Texts.Error.LackOfTab, tabID));
|
||||||
|
}
|
||||||
|
|
||||||
await storeLog('error', 8, err, 'handleLoginRequest');
|
await storeLog('error', 8, err, 'handleLoginRequest');
|
||||||
return TwoFasNotification.show(config.Texts.Error.UndefinedError, tabID);
|
return TwoFasNotification.show(config.Texts.Error.UndefinedError, tabID);
|
||||||
});
|
});
|
||||||
|
@ -30,7 +30,7 @@ const closeRequest = async (tabID, requestID) => {
|
|||||||
return storeLog('error', 30, err);
|
return storeLog('error', 30, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!storage || !storage[`tabData-${tabID}`].requestID || requestID !== storage[`tabData-${tabID}`].requestID) {
|
if (!storage || !storage[`tabData-${tabID}`]?.requestID || requestID !== storage[`tabData-${tabID}`]?.requestID) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,10 @@ const config = {
|
|||||||
InactiveTab: {
|
InactiveTab: {
|
||||||
Title: browser.i18n.getMessage('errorInactiveTabTitle') || t.errorInactiveTabTitle,
|
Title: browser.i18n.getMessage('errorInactiveTabTitle') || t.errorInactiveTabTitle,
|
||||||
Message: browser.i18n.getMessage('errorInactiveTabMessage') || t.errorInactiveTabMessage
|
Message: browser.i18n.getMessage('errorInactiveTabMessage') || t.errorInactiveTabMessage
|
||||||
|
},
|
||||||
|
LackOfTab: {
|
||||||
|
Title: browser.i18n.getMessage('errorLackOfTabTitle') || t.errorLackOfTabTitle,
|
||||||
|
Message: browser.i18n.getMessage('errorLackOfTabMessage') || t.errorLackOfTabMessage
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Warning: {
|
Warning: {
|
||||||
|
Loading…
Reference in New Issue
Block a user