파일이 다운로드/업로드된 직후에 다운로드/업로드 페이지의 목록에서 바로 사라지던 버그 수정

This commit is contained in:
static
2025-12-31 01:32:54 +09:00
parent 26323c2d4d
commit 7b666cf692
3 changed files with 14 additions and 14 deletions

View File

@@ -1,18 +1,14 @@
<script lang="ts">
import { FullscreenDiv } from "$lib/components/atoms";
import { TopBar } from "$lib/components/molecules";
import { getFileInfo } from "$lib/modules/filesystem";
import { getDownloadingFiles, clearDownloadedFiles } from "$lib/modules/file";
import { getFileInfo } from "$lib/modules/filesystem";
import { masterKeyStore } from "$lib/stores";
import File from "./File.svelte";
let downloadingFilesPromise = $derived(
Promise.all(
getDownloadingFiles().map(async (file) => ({
state: file,
fileInfo: await getFileInfo(file.id, $masterKeyStore?.get(1)?.key!),
})),
),
const downloadingFiles = getDownloadingFiles();
const filesPromise = $derived(
Promise.all(downloadingFiles.map(({ id }) => getFileInfo(id, $masterKeyStore?.get(1)?.key!))),
);
$effect(() => clearDownloadedFiles);
@@ -24,9 +20,11 @@
<TopBar />
<FullscreenDiv>
{#await downloadingFilesPromise then downloadingFiles}
{#each downloadingFiles as { state, fileInfo }}
<File {state} info={fileInfo} />
{/each}
{#await filesPromise then files}
<div class="space-y-2 pb-4">
{#each files as file, index}
<File state={downloadingFiles[index]!} info={file} />
{/each}
</div>
{/await}
</FullscreenDiv>

View File

@@ -4,6 +4,8 @@
import { getUploadingFiles, clearUploadedFiles } from "$lib/modules/file";
import File from "./File.svelte";
const uploadingFiles = getUploadingFiles();
$effect(() => clearUploadedFiles);
</script>
@@ -14,7 +16,7 @@
<TopBar />
<FullscreenDiv>
<div class="space-y-2 pb-4">
{#each getUploadingFiles() as file}
{#each uploadingFiles as file}
<File state={file} />
{/each}
</div>