Fix lastReadId logic
This commit is contained in:
parent
5c580c1ecd
commit
a121d60c1b
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue