mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add a retry button.
This commit is contained in:
@@ -91,6 +91,13 @@ function TaskTile({task}: {task: UploadingTask}) {
|
|||||||
<progress className="progress progress-primary my-2" value={100 * progress} max={100} />
|
<progress className="progress progress-primary my-2" value={100 * progress} max={100} />
|
||||||
{error && <p className={"text-error p-1"}>{error}</p>}
|
{error && <p className={"text-error p-1"}>{error}</p>}
|
||||||
<div className={"my-2 flex flex-row-reverse"}>
|
<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={() => {
|
<button className={"btn btn-error h-7"} onClick={() => {
|
||||||
const dialog = document.getElementById(`cancel_task_${task.id}`) as HTMLDialogElement;
|
const dialog = document.getElementById(`cancel_task_${task.id}`) as HTMLDialogElement;
|
||||||
dialog.showModal();
|
dialog.showModal();
|
||||||
|
@@ -124,6 +124,7 @@ export class UploadingTask extends Listenable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
|
this.errorMessage = null;
|
||||||
this.status = UploadingStatus.UPLOADING;
|
this.status = UploadingStatus.UPLOADING;
|
||||||
this.notifyListeners();
|
this.notifyListeners();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
Reference in New Issue
Block a user