Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231482

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/82/231482/1

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: newchange
Gerrit-Change-Id: Iab1574e2abb4c504ba4f39e3d1978f35052eef9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

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

Reply via email to