Jdlrobson has uploaded a new change for review.

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

Change subject: Ensure we log success events
......................................................................

Ensure we log success events

It's possible a page reload might be preventing the success event
from logging. Let's make sure this is not the case.

Change-Id: If2c61911d0db57fae70dc4dae0f37c7835978402
---
M javascripts/modules/editor/EditorOverlayBase.js
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/64/162164/1

diff --git a/javascripts/modules/editor/EditorOverlayBase.js 
b/javascripts/modules/editor/EditorOverlayBase.js
index 2ab64ff..2ce44d3 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -40,7 +40,7 @@
                        if ( errorText ) {
                                data.errorText = errorText;
                        }
-                       schema.log( data );
+                       return schema.log( data );
                },
                /**
                 * Reveals a spinner at the top of the overlay.
@@ -78,7 +78,6 @@
                 * messages, and setting mobile edit cookie.
                 */
                onSave: function() {
-                       this.log( 'success' );
                        var title = this.options.title,
                                msg;
 
@@ -98,8 +97,14 @@
                        // Does reloading page via JavaScript after edit 
encourage more editing?
                        if ( isTestA ) {
                                M.settings.saveUserSetting( 
'mobile-pending-toast', msg );
-                               window.location = mw.util.getUrl( title );
+
+                               // Ensure we don't lose this event when logging
+                               this.log( 'success' ).always( function() {
+                                       window.location = mw.util.getUrl( title 
);
+                               } );
                                return;
+                       } else {
+                               this.log( 'success' );
                        }
 
                        new Page( { title: title, el: $( '#content_wrapper' ) } 
).on( 'ready', M.reloadPage ).

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2c61911d0db57fae70dc4dae0f37c7835978402
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to