jenkins-bot has submitted this change and it was merged.

Change subject: Remove window even if closing promise rejects
......................................................................


Remove window even if closing promise rejects

The closing promise rejects when the window is already closed.
In this case we still want to remove the window.

Bug: T76659
Change-Id: Idc87ae6089fa5521d36c20251f4ca54a2257b0ab
---
M src/WindowManager.js
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Looks good to me, but someone else must approve
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/WindowManager.js b/src/WindowManager.js
index 90fcc8f..1e40ff3 100644
--- a/src/WindowManager.js
+++ b/src/WindowManager.js
@@ -551,7 +551,7 @@
  * @throws {Error} If windows being removed are not being managed
  */
 OO.ui.WindowManager.prototype.removeWindows = function ( names ) {
-       var i, len, win, name,
+       var i, len, win, name, cleanupWindow,
                manager = this,
                promises = [],
                cleanup = function ( name, win ) {
@@ -565,7 +565,8 @@
                if ( !win ) {
                        throw new Error( 'Cannot remove window' );
                }
-               promises.push( this.closeWindow( name ).then( cleanup.bind( 
null, name, win ) ) );
+               cleanupWindow = cleanup.bind( null, name, win );
+               promises.push( this.closeWindow( name ).then( cleanupWindow, 
cleanupWindow ) );
        }
 
        return $.when.apply( $, promises );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc87ae6089fa5521d36c20251f4ca54a2257b0ab
Gerrit-PatchSet: 4
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to