mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-12 21:08:46 +00:00
페이지가 열릴 때 영구 저장소 사용을 요청하도록 개선
This commit is contained in:
@@ -4,6 +4,15 @@ import { prepareFileCache } from "$lib/modules/file";
|
||||
import { prepareOpfs } from "$lib/modules/opfs";
|
||||
import { clientKeyStore, masterKeyStore, hmacSecretStore } from "$lib/stores";
|
||||
|
||||
const requestPersistentStorage = async () => {
|
||||
const isPersistent = await navigator.storage.persist();
|
||||
if (isPersistent) {
|
||||
console.log("[ArkVault] Persistent storage granted.");
|
||||
} else {
|
||||
console.warn("[ArkVault] Persistent storage not granted.");
|
||||
}
|
||||
};
|
||||
|
||||
const prepareClientKeyStore = async () => {
|
||||
const [encryptKey, decryptKey, signKey, verifyKey] = await Promise.all([
|
||||
getClientKey("encrypt"),
|
||||
@@ -32,6 +41,7 @@ const prepareHmacSecretStore = async () => {
|
||||
|
||||
export const init: ClientInit = async () => {
|
||||
await Promise.all([
|
||||
requestPersistentStorage(),
|
||||
prepareFileCache(),
|
||||
prepareClientKeyStore(),
|
||||
prepareMasterKeyStore(),
|
||||
|
||||
Reference in New Issue
Block a user