mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-25 11:40:30 +01:00
#1091 installPage - storageValidation improvement
This commit is contained in:
parent
53c5c44218
commit
9cb93cafcc
@ -24,7 +24,7 @@ const SDK = require('../sdk');
|
||||
const TwoFasNotification = require('../notification');
|
||||
const loadFromLocalStorage = require('../localStorage/loadFromLocalStorage');
|
||||
const subscribeChannel = require('../background/functions/subscribeChannel');
|
||||
const { extPageOnMessage, handleTargetBlank, hidePreloader, storageValidation, storeLog } = require('../partials');
|
||||
const { delay, extPageOnMessage, handleTargetBlank, hidePreloader, storageValidation, storeLog } = require('../partials');
|
||||
const { generateQRCode, installContainerHandlers } = require('./functions');
|
||||
|
||||
const installPageError = async err => {
|
||||
@ -35,7 +35,16 @@ const installPageError = async err => {
|
||||
const init = async storage => {
|
||||
i18n();
|
||||
|
||||
await storageValidation(storage);
|
||||
try {
|
||||
await storageValidation(storage);
|
||||
} catch (e) {
|
||||
return delay(() => {
|
||||
return browser.runtime.sendMessage({ action: 'storageReset' })
|
||||
.then(() => window.location.reload())
|
||||
.catch(async err => await storeLog('error', 38, err, 'storageValidationReload'));
|
||||
}, 5300);
|
||||
}
|
||||
|
||||
const channel = await subscribeChannel(storage, null, {
|
||||
action: false,
|
||||
timeout: false,
|
||||
|
Loading…
Reference in New Issue
Block a user