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

Change subject: Short-circuit switching to the already active editor
......................................................................


Short-circuit switching to the already active editor

If we allow this to proceed, we will call .setup() on the
editor (even though we've already done that), followed by
.teardown(). A pattern like x.setup(); x.setup(); x.teardown();
tends not to result in x being in a reasonable state.

Change-Id: Ie2e9bb42a6202a24d492cfa1f1ad76842d3e4e60
---
M modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Mooeypoo: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js 
b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
index 4a2c8e4..8572347 100644
--- a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
+++ b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
@@ -191,6 +191,10 @@
                        return $.Deferred().reject().promise();
                }
 
+               if ( this.activeEditorName === name ) {
+                       return $.Deferred().resolve().promise();
+               }
+
                if ( this.switchingPromise ) {
                        if ( this.switchingPromise.newEditorName === name ) {
                                return this.switchingPromise;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2e9bb42a6202a24d492cfa1f1ad76842d3e4e60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to