From 3828f29160d2f9eccfe2c49052b6fc29d91ea670 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Mon, 21 Dec 2015 10:49:11 -0800 Subject: [PATCH] Only update seenTime in the local API Do not send an update to 'seenTime' to remote wikis; only update the items that are in the local API. Bug: T121928 Change-Id: I291ecdb53364327dbdcb769c0d93512eeed3ab29 --- modules/viewmodel/mw.echo.dm.NotificationsModel.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/viewmodel/mw.echo.dm.NotificationsModel.js b/modules/viewmodel/mw.echo.dm.NotificationsModel.js index 4dfb6915d..1f53b4442 100644 --- a/modules/viewmodel/mw.echo.dm.NotificationsModel.js +++ b/modules/viewmodel/mw.echo.dm.NotificationsModel.js @@ -314,7 +314,7 @@ * @fires updateSeenTime */ mw.echo.dm.NotificationsModel.prototype.updateSeenTime = function ( type ) { - var i, len, + var i, len, promise, items = this.unseenNotifications.getItems(); type = type || this.type; @@ -325,7 +325,14 @@ } this.emit( 'updateSeenTime' ); - return this.getApi().updateSeenTime( type ) + // Only update seenTime in the API locally + if ( !this.isExternal() ) { + promise = this.getApi().updateSeenTime( type ); + } else { + promise = $.Deferred().resolve(); + } + + return promise .then( this.setSeenTime.bind( this ) ); };