Skip to content

Commit 086b03f

Browse files
committed
chore(drives): remove the SIMULATE_UPLOAD test stub
Restore the real upload transport: drop the simulated-progress branch in uploadMountFile and the SIMULATE_UPLOAD success-persistence in useMountUpload, so a completed upload drops the optimistic tile and the real file arrives via the listing refetch (the file store endpoint is the source of truth again).
1 parent 8f66404 commit 086b03f

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

web/oss/src/components/Drives/useMountUpload.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {queryClientAtom} from "jotai-tanstack-query"
66

77
import {projectIdAtom} from "@/oss/state/project"
88

9-
import {SIMULATE_UPLOAD, uploadMountFile} from "./driveMedia"
9+
import {uploadMountFile} from "./driveMedia"
1010
import {useImagePreviews} from "./useImagePreviews"
1111

1212
/**
@@ -96,14 +96,8 @@ export function useMountUpload(): MountUpload {
9696
.then(() => {
9797
if (controller.signal.aborted) return
9898
controllers.current.delete(id)
99-
// TEMP(test): with the transport stubbed no real file arrives from a refetch, so
100-
// removing the optimistic tile just made the drop "disappear". Keep it as a done
101-
// tile instead. Remove with the SIMULATE_UPLOAD stub.
102-
if (SIMULATE_UPLOAD) {
103-
patch(id, {percent: 100})
104-
return
105-
}
106-
// Dropping the item removes its file from the list → useImagePreviews revokes the URL.
99+
// On success the real file arrives via the listing refetch, so drop the optimistic
100+
// item — removing its file from the list also lets useImagePreviews revoke the URL.
107101
sources.current.delete(id)
108102
setItems((prev) => prev.filter((it) => it.id !== id))
109103
refreshListing()

0 commit comments

Comments
 (0)