fix issues

pull/1778/head
Brice-W 4 years ago
parent db46c2960b
commit 1397107dff

@ -191,15 +191,16 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
this.throttledNotify = _.debounce(this.notify, 500, { maxWait: 1000 }); this.throttledNotify = _.debounce(this.notify, 500, { maxWait: 1000 });
//start right away the function is called, and wait 1sec before calling it again //start right away the function is called, and wait 1sec before calling it again
//this.markRead = _.debounce(this.markReadBouncy, 1000, { leading: true }); //this.markRead = _.debounce(this.markReadBouncy, 1000, { leading: true });
const markReadBouncy = _.debounce(this.markReadBouncy, 1000, { leading: true }) const markReadBouncy = _.debounce(this.markReadBouncy, 1000, { leading: true });
this.markRead = (newestUnreadDate: number) => { this.markRead = (newestUnreadDate: number) => {
const lastReadTimestamp = this.get('lastReadTimestamp'); const lastReadTimestamp = this.get('lastReadTimestamp');
if (newestUnreadDate > lastReadTimestamp) if (newestUnreadDate > lastReadTimestamp) {
this.set({ this.set({
lastReadTimestamp: newestUnreadDate, lastReadTimestamp: newestUnreadDate,
}); });
markReadBouncy(newestUnreadDate); }
} void markReadBouncy(newestUnreadDate);
};
// Listening for out-of-band data updates // Listening for out-of-band data updates
this.typingRefreshTimer = null; this.typingRefreshTimer = null;
@ -913,7 +914,6 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
} }
public async markReadBouncy(newestUnreadDate: number, providedOptions: any = {}) { public async markReadBouncy(newestUnreadDate: number, providedOptions: any = {}) {
const lastReadTimestamp = this.get('lastReadTimestamp'); const lastReadTimestamp = this.get('lastReadTimestamp');
if (newestUnreadDate < lastReadTimestamp) { if (newestUnreadDate < lastReadTimestamp) {
return; return;

Loading…
Cancel
Save