diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2021-11-29 20:06:20 -0500 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2021-11-29 20:06:20 -0500 |
| commit | 780b7dc6fd1830244a6236905a6e8ce9afcfb993 (patch) | |
| tree | 8500c68df664bc8f46651c79095147a76dcf1733 /client/js/controllers/post_upload_controller.js | |
| parent | 9f95e9eb90258f77518f7f5d3d7421333ba28e34 (diff) | |
client/upload: restore option to pause upload chain on error
Diffstat (limited to 'client/js/controllers/post_upload_controller.js')
| -rw-r--r-- | client/js/controllers/post_upload_controller.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/client/js/controllers/post_upload_controller.js b/client/js/controllers/post_upload_controller.js index a54baec..720a116 100644 --- a/client/js/controllers/post_upload_controller.js +++ b/client/js/controllers/post_upload_controller.js @@ -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) { |