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 {
|
export default class StoragePersist extends Vue {
|
||||||
async mounted(): Promise<void> {
|
async mounted(): Promise<void> {
|
||||||
if (!navigator.storage) {
|
if (!navigator.storage) {
|
||||||
toast.error(this.$t('localStoragePersistNotSupported'), {autoClose: false, theme: 'colored'});
|
toast.error(this.$t('localStorage.notSupported'));
|
||||||
} else {
|
} else if (!await navigator.storage.persist()) {
|
||||||
await navigator.storage.persist();
|
toast.warning(this.$t('localStorage.persistent.notSupported'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,12 @@ export const messagesDe = {
|
|||||||
},
|
},
|
||||||
locale: 'Sprache',
|
locale: 'Sprache',
|
||||||
locales: messagesEn.locales,
|
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: {
|
manga: {
|
||||||
chapters: {
|
chapters: {
|
||||||
newCount: '#Neue Kapitel',
|
newCount: '#Neue Kapitel',
|
||||||
|
|||||||
@@ -17,7 +17,12 @@ export const messagesEn = {
|
|||||||
'de': 'Deutsch',
|
'de': 'Deutsch',
|
||||||
'en': 'English',
|
'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: {
|
manga: {
|
||||||
chapters: {
|
chapters: {
|
||||||
newCount: '#new chapters',
|
newCount: '#new chapters',
|
||||||
|
|||||||
Reference in New Issue
Block a user