diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-07-05 06:53:29 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-07-05 06:53:29 +0000 |
| commit | af4a26b5882807d834c8fcfdf5d10121f63d18d5 (patch) | |
| tree | 6b56d027f3231c0a7c5a18cee1ebd6d010cd7e66 /src/main.js | |
| parent | acc3b083aa46aa9c165578380b16ef86e6fb596b (diff) | |
| parent | 9cac5d94dd78ea331254307871e876da7e266a6f (diff) | |
Merge branch 'feat/allow-use-without-cookies' into 'develop'
Fix #815: Allow use without cookies, Add a global notice popup system
Closes #815
See merge request pleroma/pleroma-fe!1166
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 }) })() |
