local storage: better permissions handling

This commit is contained in:
wea_ondara
2023-10-06 19:47:23 +02:00
parent baea085def
commit 91179a2794
3 changed files with 15 additions and 5 deletions

View File

@@ -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'));
}
}
}

View File

@@ -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',

View File

@@ -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',