DLynch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364227 )

Change subject: WindowManager: fix closing promise state check
......................................................................

WindowManager: fix closing promise state check

Async promise resolution means that `deferreds.closing` and `closing` can have
their state out of sync if a window is closed multiple times in the same tick.
As such, check the state on `deferreds.closing` directly, since that's what
the preparingToClose promise directly manipulates.

Bug: T169844
Change-Id: I43b378e2e235f0425845844d3047ab506fd5f786
---
M src/WindowManager.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/27/364227/1

diff --git a/src/WindowManager.js b/src/WindowManager.js
index 1945318..2c58fe4 100644
--- a/src/WindowManager.js
+++ b/src/WindowManager.js
@@ -474,7 +474,7 @@
                error = 'Cannot close window: window is not attached to 
manager';
        } else if ( win !== this.currentWindow ) {
                error = 'Cannot close window: window already closed with 
different data';
-       } else if ( this.preparingToClose || lifecycle.closing.state() === 
'resolved' ) {
+       } else if ( this.preparingToClose || 
lifecycle.deferreds.closing.state() === 'resolved' ) {
                error = 'Cannot close window: window already closing with 
different data';
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43b378e2e235f0425845844d3047ab506fd5f786
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

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

Reply via email to