local storage: better permissions handling
This commit is contained in:
@@ -6,9 +6,9 @@ import {toast} from 'vue3-toastify';
|
||||
export default class StoragePersist extends Vue {
|
||||
async mounted(): Promise<void> {
|
||||
if (!navigator.storage) {
|
||||
toast.error(this.$t('localStoragePersistNotSupported'), {autoClose: false, theme: 'colored'});
|
||||
} else {
|
||||
await navigator.storage.persist();
|
||||
toast.error(this.$t('localStorage.notSupported'));
|
||||
} else if (!await navigator.storage.persist()) {
|
||||
toast.warning(this.$t('localStorage.persistent.notSupported'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,12 @@ export const messagesDe = {
|
||||
},
|
||||
locale: 'Sprache',
|
||||
locales: messagesEn.locales,
|
||||
localStoragePersistNotSupported: 'Lokaler Speicher wird nicht permanent. Das könnte in längere Wartezeiten verursachen!',
|
||||
localStorage: {
|
||||
notSupported: 'Lokaler Speicher wird nicht unterstützt. Diese Anwendung funktioniert möglicherweise nicht!',
|
||||
persistent: {
|
||||
notSupported: 'Lokaler Speicher wird nicht persistent. Das könnte in längere Wartezeiten verursachen!',
|
||||
},
|
||||
},
|
||||
manga: {
|
||||
chapters: {
|
||||
newCount: '#Neue Kapitel',
|
||||
|
||||
@@ -17,7 +17,12 @@ export const messagesEn = {
|
||||
'de': 'Deutsch',
|
||||
'en': 'English',
|
||||
},
|
||||
localStoragePersistNotSupported: 'Local storage will not be persisted. This could result in longer loading times!',
|
||||
localStorage: {
|
||||
notSupported: 'Local storage is not supported. The application will probably not work!',
|
||||
persistent: {
|
||||
notSupported: 'Local storage will not be persisted. This could result in longer loading times!',
|
||||
},
|
||||
},
|
||||
manga: {
|
||||
chapters: {
|
||||
newCount: '#new chapters',
|
||||
|
||||
Reference in New Issue
Block a user