Commit fdf1a977 authored by JC Brand's avatar JC Brand

Bugfix. Fall back to normal query when no messages

parent 76170427
...@@ -78,15 +78,19 @@ ...@@ -78,15 +78,19 @@
(result) => { // Success (result) => { // Success
if (result.supported) { if (result.supported) {
const most_recent_msg = utils.getMostRecentMessage(this.model); const most_recent_msg = utils.getMostRecentMessage(this.model);
const archive_id = most_recent_msg.get('archive_id'); if (_.isNil(most_recent_msg)) {
if (archive_id) { this.fetchArchivedMessages();
this.fetchArchivedMessages({
'after': most_recent_msg.get('archive_id')
});
} else { } else {
this.fetchArchivedMessages({ const archive_id = most_recent_msg.get('archive_id');
'start': most_recent_msg.get('time') if (archive_id) {
}); this.fetchArchivedMessages({
'after': most_recent_msg.get('archive_id')
});
} else {
this.fetchArchivedMessages({
'start': most_recent_msg.get('time')
});
}
} }
} else { } else {
this.clearSpinner(); this.clearSpinner();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment