diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 17:34:35 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 17:34:35 +0300 |
| commit | ddde05771fdda8e07ff757c3469ab981ef2be295 (patch) | |
| tree | 6270c5f68038b8e75b340f6d03c69d4e562847c5 /src/main.js | |
| parent | 77bb31b474f16aa2bbda66e2aa73cf0d20eb934e (diff) | |
| parent | 7206fee4372eba5bb05db9eb90100aee95003962 (diff) | |
update with bookmarks, clean up some code
Diffstat (limited to 'src/main.js')
| -rw-r--r-- | src/main.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.js b/src/main.js index 9a201e4f..5bddc76e 100644 --- a/src/main.js +++ b/src/main.js @@ -62,7 +62,15 @@ const persistedStateOptions = { }; (async () => { - const persistedState = await createPersistedState(persistedStateOptions) + let storageError = false + const plugins = [pushNotifications] + try { + const persistedState = await createPersistedState(persistedStateOptions) + plugins.push(persistedState) + } catch (e) { + console.error(e) + storageError = true + } const store = new Vuex.Store({ modules: { i18n: { @@ -85,11 +93,13 @@ const persistedStateOptions = { polls: pollsModule, postStatus: postStatusModule }, - plugins: [persistedState, pushNotifications], + plugins, strict: false // Socket modifies itself, let's ignore this for now. // strict: process.env.NODE_ENV !== 'production' }) - + if (storageError) { + store.dispatch('pushGlobalNotice', { messageKey: 'errors.storage_unavailable', level: 'error' }) + } afterStoreSetup({ store, i18n }) })() |
