feat: upload queue with queued status and cancel button
Multi-file drops now show queued/uploading distinction. Jobs start as 'queued' and transition to 'uploading' when the HTTP request begins. Queued items show a cancel button in the upload panel. Cancelled jobs are skipped in the sequential upload loop.
This commit is contained in:
@@ -242,9 +242,18 @@ export function setupDragDrop(
|
||||
continue;
|
||||
}
|
||||
|
||||
const placeholder = createPlaceholder(viewport, cursorX, cursorY);
|
||||
const jobId = uploads?.addJob(file, boardId);
|
||||
|
||||
// Check if job was cancelled while queued (user clicked cancel)
|
||||
if (jobId && uploads?.isCancelled(jobId)) {
|
||||
col++;
|
||||
if (col >= cols) { col = 0; row++; cursorY += rowMaxH + GAP; rowMaxH = 0; }
|
||||
continue;
|
||||
}
|
||||
|
||||
const placeholder = createPlaceholder(viewport, cursorX, cursorY);
|
||||
if (jobId) uploads?.startUpload(jobId);
|
||||
|
||||
try {
|
||||
const res = await uploadImage(boardId, file, (p) => {
|
||||
if (jobId) uploads?.setProgress(jobId, p);
|
||||
|
||||
Reference in New Issue
Block a user