Add a retry button.

This commit is contained in:
nyne
2025-05-16 18:18:58 +08:00
parent 271cde9e1e
commit c113d33671
2 changed files with 16 additions and 8 deletions

View File

@@ -91,6 +91,13 @@ function TaskTile({task}: {task: UploadingTask}) {
<progress className="progress progress-primary my-2" value={100 * progress} max={100} />
{error && <p className={"text-error p-1"}>{error}</p>}
<div className={"my-2 flex flex-row-reverse"}>
{
error && <button className={"btn h-7 mr-1"} onClick={() => {
task.start();
}}>
Retry
</button>
}
<button className={"btn btn-error h-7"} onClick={() => {
const dialog = document.getElementById(`cancel_task_${task.id}`) as HTMLDialogElement;
dialog.showModal();

View File

@@ -124,6 +124,7 @@ export class UploadingTask extends Listenable {
}
async start() {
this.errorMessage = null;
this.status = UploadingStatus.UPLOADING;
this.notifyListeners();
await Promise.all([