Nikerabbit has uploaded a new change for review.

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

Change subject: Unnecessary ajax requests for workflowstates
......................................................................

Unnecessary ajax requests for workflowstates

Bug: 60950
Change-Id: I097414eb678b01efc0dc2227ba52437a50d7236a
---
M resources/js/ext.translate.workflowselector.js
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/25/112425/1

diff --git a/resources/js/ext.translate.workflowselector.js 
b/resources/js/ext.translate.workflowselector.js
index cb6beb8..c885239 100644
--- a/resources/js/ext.translate.workflowselector.js
+++ b/resources/js/ext.translate.workflowselector.js
@@ -32,9 +32,14 @@
                receiveState: function ( groupId, language, state ) {
                        var instance = this;
                        instance.currentState = state;
-                       instance.groupId = groupId;
                        instance.language = language;
 
+                       // Only if groupId changes, fetch the new states
+                       if ( instance.groupId === groupId ) {
+                               return;
+                       }
+
+                       instance.groupId = groupId;
                        mw.translate.getMessageGroup( groupId, 'workflowstates' 
)
                                .done( function ( group ) {
                                        instance.states = group.workflowstates;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I097414eb678b01efc0dc2227ba52437a50d7236a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

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

Reply via email to