From a121d60c1b72e60c9712d959ae30348e3a7ef98a Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 1 Feb 2018 19:34:14 -0700 Subject: [PATCH] Fix lastReadId logic --- core/fse.js | 1 - core/msg_list.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/fse.js b/core/fse.js index c0135919..8a409589 100644 --- a/core/fse.js +++ b/core/fse.js @@ -129,7 +129,6 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul } this.noUpdateLastReadId = _.get(options, 'extraArgs.noUpdateLastReadId', config.noUpdateLastReadId) || false; - console.log(this.noUpdateLastReadId); this.isReady = false; diff --git a/core/msg_list.js b/core/msg_list.js index d48c1588..ab0ab108 100644 --- a/core/msg_list.js +++ b/core/msg_list.js @@ -141,6 +141,7 @@ exports.getModule = class MessageListModule extends MessageAreaConfTempSwitcher( const self = this; const vc = self.viewControllers.allViews = new ViewController( { client : self.client } ); + let configProvidedMessageList = false; async.series( [ @@ -157,6 +158,7 @@ exports.getModule = class MessageListModule extends MessageAreaConfTempSwitcher( // Config can supply messages else we'll need to populate the list now // if(_.isArray(self.config.messageList)) { + configProvidedMessageList = true; return callback(0 === self.config.messageList.length ? new Error('No messages in area') : null); } @@ -171,7 +173,7 @@ exports.getModule = class MessageListModule extends MessageAreaConfTempSwitcher( }, function getLastReadMesageId(callback) { // messageList entries can contain |isNew| if they want to be considered new - if(Array.isArray(self.config.messageList)) { + if(configProvidedMessageList) { self.lastReadId = 0; return callback(null); }