mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-17 23:48:45 +00:00
파일 업로드/다운로드 현황을 모두 볼 수 있는 페이지 구현
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
import { onMount } from "svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { goto as svelteGoto } from "$app/navigation";
|
||||
import { fileUploadStatusStore, clientKeyStore, masterKeyStore } from "$lib/stores";
|
||||
import {
|
||||
fileUploadStatusStore,
|
||||
fileDownloadStatusStore,
|
||||
isFileUploading,
|
||||
isFileDownloading,
|
||||
clientKeyStore,
|
||||
masterKeyStore,
|
||||
} from "$lib/stores";
|
||||
import "../app.css";
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
const checkFileUploadStatus = (e: BeforeUnloadEvent) => {
|
||||
const protectFileUploadAndDownload = (e: BeforeUnloadEvent) => {
|
||||
if (
|
||||
$fileUploadStatusStore.some((statusStore) => {
|
||||
const status = get(statusStore);
|
||||
return (
|
||||
status.status === "encryption-pending" ||
|
||||
status.status === "encrypting" ||
|
||||
status.status === "upload-pending" ||
|
||||
status.status === "uploading"
|
||||
);
|
||||
})
|
||||
$fileUploadStatusStore.some((status) => isFileUploading(get(status).status)) ||
|
||||
$fileDownloadStatusStore.some((status) => isFileDownloading(get(status).status))
|
||||
) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -41,6 +41,6 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:window onbeforeunload={checkFileUploadStatus} />
|
||||
<svelte:window onbeforeunload={protectFileUploadAndDownload} />
|
||||
|
||||
{@render children()}
|
||||
|
||||
Reference in New Issue
Block a user