mediawiki.Upload: Return same data for upload & stashed upload
authorEd Sanders <esanders@wikimedia.org>
Tue, 22 Sep 2015 15:18:55 +0000 (16:18 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 22 Sep 2015 17:45:12 +0000 (17:45 +0000)
The stashed upload was omitting the imageinfo and raw result in the promise.

Change-Id: I79462c1121c879d90eed3d245948335cd08bba30

resources/src/mediawiki/mediawiki.Upload.js

index 79628de..aafc37a 100644 (file)
                                comment: upload.getComment(),
                                filename: upload.getFilename(),
                                text: upload.getText()
-                       } ).then( function () {
+                       } ).then( function ( result ) {
                                upload.state = Upload.State.UPLOADED;
+                               upload.imageinfo = result.upload.imageinfo;
+                               return result;
                        }, function () {
                                upload.state = Upload.State.ERROR;
                        } );