사소한 리팩토링

This commit is contained in:
static
2025-01-18 12:48:01 +09:00
parent d0d4afd2c3
commit da47a07da7
5 changed files with 7 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
import { get, type Writable } from "svelte/store";
import { TopBar } from "$lib/components";
import { getFileInfo, type FileInfo } from "$lib/modules/filesystem";
import { fileDownloadStatusStore, masterKeyStore } from "$lib/stores";
import { fileDownloadStatusStore, isFileDownloading, masterKeyStore } from "$lib/stores";
import DownloadStatus from "./DownloadStatus.svelte";
import { requestFileDownload } from "./service";
@@ -14,14 +14,8 @@
const downloadStatus = $derived(
$fileDownloadStatusStore.find((statusStore) => {
const status = get(statusStore);
return (
status.id === data.id &&
(status.status === "download-pending" ||
status.status === "downloading" ||
status.status === "decryption-pending" ||
status.status === "decrypting")
);
const { id, status } = get(statusStore);
return id === data.id && isFileDownloading(status);
}),
);