ssb: Fix various channel / unread status / show new messages bugs.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m35s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m35s
This commit is contained in:
@ -165,7 +165,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
`,
|
||||
[JSON.stringify(this.following), start_time, end_time]
|
||||
);
|
||||
result = (await this.decrypt(result)).filter(x => x.decrypted);
|
||||
result = (await this.decrypt(result)).filter((x) => x.decrypted);
|
||||
} else {
|
||||
let promises = [];
|
||||
const k_following_limit = 256;
|
||||
@ -274,7 +274,10 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
let end_time = now + 24 * 60 * 60 * 1000;
|
||||
let messages = [];
|
||||
try {
|
||||
messages = await this.fetch_messages(this.time_range[1], end_time);
|
||||
messages = await this.fetch_messages(
|
||||
this.time_range[1] - 24 * 60 * 60 * 1000,
|
||||
end_time
|
||||
);
|
||||
messages = await this.decrypt(messages);
|
||||
this.update_time_range_from_messages(
|
||||
messages.filter(
|
||||
@ -284,7 +287,9 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
} finally {
|
||||
this.loading--;
|
||||
}
|
||||
this.messages = [...this.messages, ...messages];
|
||||
this.messages = Object.values(
|
||||
Object.fromEntries([...this.messages, ...messages].map((x) => [x.id, x]))
|
||||
);
|
||||
console.log('done loading latest messages.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user