diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-01 19:15:28 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-01 19:15:28 +0300 |
| commit | d30b0b28c9371e56ffe54b5a8b56087718221c1d (patch) | |
| tree | 2ef028c630edb52a2377e8a5ab6ee6492543afec /src/main.js | |
| parent | beb160bd537abcb7f2e147c7954886d2f51d385f (diff) | |
catch localforage error and let the application work, add an alert for user to dismiss
Diffstat (limited to 'src/main.js')
| -rw-r--r-- | src/main.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.js b/src/main.js index 9a201e4f..bb2c8cd3 100644 --- a/src/main.js +++ b/src/main.js @@ -62,7 +62,16 @@ const persistedStateOptions = { }; (async () => { - const persistedState = await createPersistedState(persistedStateOptions) + console.log('before perse state') + let persistedState + let storageError = 'none' + try { + persistedState = await createPersistedState(persistedStateOptions) + } catch (e) { + console.error(e) + storageError = 'show' + persistedState = _ => _ + } const store = new Vuex.Store({ modules: { i18n: { @@ -89,7 +98,7 @@ const persistedStateOptions = { strict: false // Socket modifies itself, let's ignore this for now. // strict: process.env.NODE_ENV !== 'production' }) - + store.dispatch('setStorageError', storageError) afterStoreSetup({ store, i18n }) })() |
