mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-15 22:38:47 +00:00
Store 초기화를 hooks.client.ts에서 수행하도록 변경
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import { goto } from "$app/navigation";
|
||||
import { TitleDiv } from "$lib/components/divs";
|
||||
import { clientKeyStore, masterKeyStore } from "$lib/stores";
|
||||
@@ -14,17 +15,13 @@
|
||||
: undefined,
|
||||
);
|
||||
|
||||
$effect(() => {
|
||||
if ($masterKeyStore) {
|
||||
goto(data.redirectPath);
|
||||
} else if ($clientKeyStore) {
|
||||
requestMasterKeyDownload($clientKeyStore.decryptKey, $clientKeyStore.verifyKey).then(
|
||||
async (ok) => {
|
||||
if (ok) {
|
||||
return await goto(data.redirectPath);
|
||||
}
|
||||
},
|
||||
);
|
||||
onMount(async () => {
|
||||
if (
|
||||
$masterKeyStore ||
|
||||
($clientKeyStore &&
|
||||
(await requestMasterKeyDownload($clientKeyStore.decryptKey, $clientKeyStore.verifyKey)))
|
||||
) {
|
||||
await goto(data.redirectPath);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user