1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-24 01:04:16 +02:00

fix(frontend): secure contextではない場合はストレージ永続化を確認しないように (#17189)

* fix(frontend): secure contextではない場合はストレージ永続化を確認しないように

* Update Changelog
This commit is contained in:
かっこかり
2026-02-23 16:53:41 +09:00
committed by GitHub
parent d4cd47f455
commit 71f50d3280
4 changed files with 9 additions and 6 deletions

View File

@@ -3,14 +3,16 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { computed, ref, shallowRef, watch, defineAsyncComponent } from 'vue';
import { ref } from 'vue';
import * as os from '@/os.js';
import { store } from '@/store.js';
import { i18n } from '@/i18n.js';
export const storagePersisted = ref(await navigator.storage.persisted());
export const storagePersistenceSupported = window.isSecureContext && 'storage' in navigator;
export const storagePersisted = ref(storagePersistenceSupported ? await navigator.storage.persisted() : false);
export async function enableStoragePersistence() {
if (!storagePersistenceSupported) return;
try {
const persisted = await navigator.storage.persist();
if (persisted) {