Fix lastReadId logic

This commit is contained in:
Bryan Ashby 2018-02-01 19:34:14 -07:00
parent 5c580c1ecd
commit a121d60c1b
2 changed files with 3 additions and 2 deletions

View File

@ -129,7 +129,6 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul
} }
this.noUpdateLastReadId = _.get(options, 'extraArgs.noUpdateLastReadId', config.noUpdateLastReadId) || false; this.noUpdateLastReadId = _.get(options, 'extraArgs.noUpdateLastReadId', config.noUpdateLastReadId) || false;
console.log(this.noUpdateLastReadId);
this.isReady = false; this.isReady = false;

View File

@ -141,6 +141,7 @@ exports.getModule = class MessageListModule extends MessageAreaConfTempSwitcher(
const self = this; const self = this;
const vc = self.viewControllers.allViews = new ViewController( { client : self.client } ); const vc = self.viewControllers.allViews = new ViewController( { client : self.client } );
let configProvidedMessageList = false;
async.series( 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 // Config can supply messages else we'll need to populate the list now
// //
if(_.isArray(self.config.messageList)) { if(_.isArray(self.config.messageList)) {
configProvidedMessageList = true;
return callback(0 === self.config.messageList.length ? new Error('No messages in area') : null); 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) { function getLastReadMesageId(callback) {
// messageList entries can contain |isNew| if they want to be considered new // messageList entries can contain |isNew| if they want to be considered new
if(Array.isArray(self.config.messageList)) { if(configProvidedMessageList) {
self.lastReadId = 0; self.lastReadId = 0;
return callback(null); return callback(null);
} }