Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277712

Change subject: uw.controller.Upload: Only reset failed uploads when we really 
mean to retry them
......................................................................

uw.controller.Upload: Only reset failed uploads when we really mean to retry 
them

Previously, any time a new file was added, all previously failed files
would be uploaded again.

Change-Id: I219507523879a77c08476ae8af306633d6284b66
---
M resources/controller/uw.controller.Upload.js
1 file changed, 14 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/12/277712/1

diff --git a/resources/controller/uw.controller.Upload.js 
b/resources/controller/uw.controller.Upload.js
index 8a79247..366761b 100644
--- a/resources/controller/uw.controller.Upload.js
+++ b/resources/controller/uw.controller.Upload.js
@@ -146,19 +146,6 @@
 
                this.ui.hideEndButtons();
 
-               // reset any uploads in error state back to be shiny & new
-               $.each( this.uploads, function ( i, upload ) {
-                       if ( upload === undefined ) {
-                               return;
-                       }
-
-                       if ( upload.state === 'error' ) {
-                               upload.state = 'new';
-                               upload.ui.clearIndicator();
-                               upload.ui.clearStatus();
-                       }
-               } );
-
                // remove ability to change files
                // ideally also hide the "button"... but then we require 
styleable file input CSS trickery
                // although, we COULD do this just for files already in 
progress...
@@ -173,6 +160,20 @@
 
        uw.controller.Upload.prototype.retry = function () {
                uw.eventFlowLogger.logEvent( 'retry-uploads-button-clicked' );
+
+               // reset any uploads in error state back to be shiny & new
+               $.each( this.uploads, function ( i, upload ) {
+                       if ( upload === undefined ) {
+                               return;
+                       }
+
+                       if ( upload.state === 'error' ) {
+                               upload.state = 'new';
+                               upload.ui.clearIndicator();
+                               upload.ui.clearStatus();
+                       }
+               } );
+
                this.startUploads();
        };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/277712
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I219507523879a77c08476ae8af306633d6284b66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to