From d30b0b28c9371e56ffe54b5a8b56087718221c1d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 1 Jul 2020 19:15:28 +0300 Subject: [PATCH] catch localforage error and let the application work, add an alert for user to dismiss --- src/App.js | 6 ++++++ src/App.scss | 9 +++++++++ src/App.vue | 10 ++++++++++ src/i18n/en.json | 3 +++ src/main.js | 13 +++++++++++-- src/modules/instance.js | 2 +- src/modules/interface.js | 7 +++++++ 7 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 040138c9..da66fe21 100644 --- a/src/App.js +++ b/src/App.js @@ -107,6 +107,9 @@ export default { return { 'order': this.$store.state.instance.sidebarRight ? 99 : 0 } + }, + showStorageError () { + return this.$store.state.interface.storageError === 'show' } }, methods: { @@ -129,6 +132,9 @@ export default { if (changed) { this.$store.dispatch('setMobileLayout', mobileLayout) } + }, + hideStorageError () { + this.$store.dispatch('setStorageError', 'hide') } } } diff --git a/src/App.scss b/src/App.scss index f2972eda..db447f1c 100644 --- a/src/App.scss +++ b/src/App.scss @@ -806,6 +806,15 @@ nav { } } +.storage-error-notice { + text-align: center; + i { + cursor: pointer; + color: $fallback--text; + color: var(--alertErrorText, $fallback--text); + } +} + .button-icon { font-size: 1.2em; } diff --git a/src/App.vue b/src/App.vue index 7b9ad3dc..23991eac 100644 --- a/src/App.vue +++ b/src/App.vue @@ -101,6 +101,16 @@
+
+ {{ $t("errors.storage_unavailable") }} + +