diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-06 10:45:47 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-06 10:45:47 +0300 |
| commit | afdc3f96f0cd83a2f977992f68a30d7a531df7de (patch) | |
| tree | 9db58232bb5db7c9f3956e1741534990aba11aa1 /src/main.js | |
| parent | 61f34ff361a24a287ac0bf0c79fd2f77b4f2b708 (diff) | |
| parent | b761bcf3334e1f464e63a87de40eb75d0906d545 (diff) | |
fix conflicts, make subject update the preview
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 }) })() |
