mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/upload: restore option to pause upload chain on error
This commit is contained in:
@ -90,21 +90,30 @@ class PostUploadController {
|
||||
uploadable
|
||||
);
|
||||
}
|
||||
if (e.detail.pauseRemainOnError) {
|
||||
return Promise.reject();
|
||||
}
|
||||
})
|
||||
),
|
||||
Promise.resolve()
|
||||
)
|
||||
.then(() => {
|
||||
if (anyFailures) {
|
||||
this._view.showError(genericErrorMessage);
|
||||
this._view.enableForm();
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
})
|
||||
.then(
|
||||
() => {
|
||||
this._view.clearMessages();
|
||||
misc.disableExitConfirmation();
|
||||
const ctx = router.show(uri.formatClientLink("posts"));
|
||||
ctx.controller.showSuccess("Posts uploaded.");
|
||||
},
|
||||
(error) => {
|
||||
this._view.showError(genericErrorMessage);
|
||||
this._view.enableForm();
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
_uploadSinglePost(uploadable, skipDuplicates, alwaysUploadSimilar) {
|
||||
|
@ -285,7 +285,7 @@ class PostUploadView extends events.EventTarget {
|
||||
for (let uploadable of this._uploadables) {
|
||||
this._updateUploadableFromDom(uploadable);
|
||||
}
|
||||
this._submitButtonNode.value = "Resume upload";
|
||||
this._submitButtonNode.value = "Resume";
|
||||
this._emit("submit");
|
||||
}
|
||||
|
||||
@ -362,6 +362,8 @@ class PostUploadView extends events.EventTarget {
|
||||
skipDuplicates: this._skipDuplicatesCheckboxNode.checked,
|
||||
alwaysUploadSimilar:
|
||||
this._alwaysUploadSimilarCheckboxNode.checked,
|
||||
pauseRemainOnError:
|
||||
this._pauseRemainOnErrorCheckboxNode.checked,
|
||||
},
|
||||
})
|
||||
);
|
||||
@ -431,6 +433,12 @@ class PostUploadView extends events.EventTarget {
|
||||
);
|
||||
}
|
||||
|
||||
get _pauseRemainOnErrorCheckboxNode() {
|
||||
return this._hostNode.querySelector(
|
||||
"form [name=pause-remain-on-error]"
|
||||
);
|
||||
}
|
||||
|
||||
get _submitButtonNode() {
|
||||
return this._hostNode.querySelector("form [type=submit]");
|
||||
}
|
||||
|
Reference in New Issue
Block a user