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

Change subject: Don't try to change anons' preferences
......................................................................


Don't try to change anons' preferences

It doesn't work, and sends a useless API request.

Worse: it's two requests, because once the API responds
with a failure, a token refetch occurs.

Change-Id: Iab1574e2abb4c504ba4f39e3d1978f35052eef9e
---
M modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
1 file changed, 3 insertions(+), 1 deletion(-)

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 8572347..de359db 100644
--- a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
+++ b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
@@ -421,7 +421,9 @@
                }
 
                if ( currentPref !== name ) {
-                       new mw.Api().saveOption( 'flow-editor', name );
+                       if ( !mw.user.isAnon() ) {
+                               new mw.Api().saveOption( 'flow-editor', name );
+                       }
                        // Ensure we also see that preference in the current 
page
                        mw.user.options.set( 'flow-editor', name );
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab1574e2abb4c504ba4f39e3d1978f35052eef9e
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