aboutsummaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-07-13 13:25:23 -0500
committerMark Felder <feld@FreeBSD.org>2020-07-13 13:25:23 -0500
commitda94935aaa18f16ac7fbe715c4610427d68ccf72 (patch)
tree52691b7cbac2773858b245e596d56c1c5e6ea74b /src/main.js
parent2eda3d687e8c986a982057c6f5eb969aa8d403d5 (diff)
parent3e09a708f600b47dde831eeddb412828b38a0cf4 (diff)
Merge branch 'develop' into refactor/notification_settings
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/main.js b/src/main.js
index 9a201e4f..0a898022 100644
--- a/src/main.js
+++ b/src/main.js
@@ -19,6 +19,7 @@ import oauthTokensModule from './modules/oauth_tokens.js'
import reportsModule from './modules/reports.js'
import pollsModule from './modules/polls.js'
import postStatusModule from './modules/postStatus.js'
+import chatsModule from './modules/chats.js'
import VueI18n from 'vue-i18n'
@@ -62,7 +63,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: {
@@ -83,13 +92,16 @@ const persistedStateOptions = {
oauthTokens: oauthTokensModule,
reports: reportsModule,
polls: pollsModule,
- postStatus: postStatusModule
+ postStatus: postStatusModule,
+ chats: chatsModule
},
- 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 })
})()