mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
svelte-query 패키지 추가
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/svelte-query";
|
||||
import { onMount } from "svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { browser } from "$app/environment";
|
||||
import { goto as svelteGoto } from "$app/navigation";
|
||||
import {
|
||||
fileUploadStatusStore,
|
||||
@@ -10,10 +12,19 @@
|
||||
clientKeyStore,
|
||||
masterKeyStore,
|
||||
} from "$lib/stores";
|
||||
|
||||
import "../app.css";
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
enabled: browser,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const protectFileUploadAndDownload = (e: BeforeUnloadEvent) => {
|
||||
if (
|
||||
$fileUploadStatusStore.some((status) => isFileUploading(get(status).status)) ||
|
||||
@@ -43,4 +54,6 @@
|
||||
|
||||
<svelte:window onbeforeunload={protectFileUploadAndDownload} />
|
||||
|
||||
{@render children()}
|
||||
<QueryClientProvider client={queryClient}>
|
||||
{@render children()}
|
||||
</QueryClientProvider>
|
||||
|
||||
Reference in New Issue
Block a user