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 @@
(result) => { // Success
if (result.supported) {
const most_recent_msg = utils.getMostRecentMessage(this.model);
const archive_id = most_recent_msg.get('archive_id');
if (archive_id) {
this.fetchArchivedMessages({
'after': most_recent_msg.get('archive_id')
});
if (_.isNil(most_recent_msg)) {
this.fetchArchivedMessages();
} else {
this.fetchArchivedMessages({
'start': most_recent_msg.get('time')
});
const archive_id = most_recent_msg.get('archive_id');
if (archive_id) {
this.fetchArchivedMessages({
'after': most_recent_msg.get('archive_id')
});
} else {
this.fetchArchivedMessages({
'start': most_recent_msg.get('time')
});
}
}
} else {
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