+
+ if ( data.changes !== 'NO_RESULTS' ) {
+ if ( this.changesListModel.getLiveUpdate() ) {
+ return this.updateChangesList( false, null, true, false );
+ } else {
+ this.changesListModel.setNewChangesExist( true );
+ }
+ }
+ }.bind( this ) )
+ .always( this._scheduleLiveUpdate.bind( this ) );
+ };
+
+ /**
+ * @return {boolean} It's appropriate to check for new changes now
+ * @private
+ */
+ mw.rcfilters.Controller.prototype._shouldCheckForNewChanges = function () {
+ var liveUpdateFeatureFlag = mw.config.get( 'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
+ new mw.Uri().query.liveupdate;
+
+ return !document.hidden &&
+ !this.changesListModel.getNewChangesExist() &&
+ !this.updatingChangesList &&
+ liveUpdateFeatureFlag;
+ };
+
+ /**
+ * Check if new changes, newer than those currently shown, are available
+ *
+ * @return {jQuery.Promise} Promise object that resolves after trying
+ * to fetch 1 change newer than the last known 'from' parameter value
+ *
+ * @private
+ */
+ mw.rcfilters.Controller.prototype._checkForNewChanges = function () {
+ return this._fetchChangesList(
+ 'liveUpdate',
+ {
+ limit: 1,
+ from: this.changesListModel.getNextFrom()
+ }
+ );
+ };
+
+ /**
+ * Show the new changes
+ *
+ * @return {jQuery.Promise} Promise object that resolves after
+ * fetching and showing the new changes
+ */
+ mw.rcfilters.Controller.prototype.showNewChanges = function () {
+ return this.updateChangesList( false, null, true, true );