Mooeypoo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/239305
Change subject: Fix a code comment to make it much clearer
......................................................................
Fix a code comment to make it much clearer
Change-Id: Ibd7c1e050f0d0790c1712a950568e3f9b09965ca
---
M modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/05/239305/1
diff --git a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
index 005dd8e..3b9a353 100644
--- a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
@@ -195,11 +195,12 @@
var widget = this,
time = mw.now();
- // The model retrieves the fetching notifications or returns
the existing one
- // but in the case of an error from the API, the fetching
promise is not being
- // reset to null.
- // We should reset the notification population method if the
model is either not
- // in the process of fetching notifications or if it is in an
error state
+ // The model retrieves the ongoing promise or returns the
existing one that it
+ // has. When the promise is completed successfuly, it nullifies
itself so we can
+ // request for it to be rebuilt and the request to the API
resent.
+ // However, in the case of an API failure, the promise does not
nullify itself.
+ // In that case we also want the model to rebuild the request,
so in this condition
+ // we must check both cases.
if ( !this.notificationsModel.isFetchingNotifications() ||
this.notificationsModel.isFetchingErrorState() ) {
this.pushPending();
this.markAllReadButton.toggle( false );
--
To view, visit https://gerrit.wikimedia.org/r/239305
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd7c1e050f0d0790c1712a950568e3f9b09965ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits