ssb: Fix an instance of channels being stuck unread.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m22s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m22s
This commit is contained in:
@ -13,6 +13,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
drafts: {type: Object},
|
||||
expanded: {type: Object},
|
||||
channels_unread: {type: Object},
|
||||
channels_latest: {type: Object},
|
||||
loading: {type: Number},
|
||||
time_range: {type: Array},
|
||||
time_loading: {type: Array},
|
||||
@ -31,6 +32,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
this.drafts = {};
|
||||
this.expanded = {};
|
||||
this.channels_unread = {};
|
||||
this.channels_latest = {};
|
||||
this.start_time = new Date().valueOf();
|
||||
this.time_range = [0, 0];
|
||||
this.time_loading = undefined;
|
||||
@ -320,7 +322,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
mark_all_read() {
|
||||
let newest = this.messages.reduce(
|
||||
(accumulator, current) => Math.max(accumulator, current.rowid),
|
||||
-1
|
||||
this.channels_latest[this.channel()] ?? -1
|
||||
);
|
||||
if (newest >= 0) {
|
||||
this.dispatchEvent(
|
||||
|
Reference in New Issue
Block a user