ssb: Canceling loads, more mobile-friendly sidebar, and respond to channel subscription changes.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m30s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m30s
This commit is contained in:
@ -68,7 +68,10 @@ class TfElement extends LitElement {
|
||||
let ids = (await tfrpc.rpc.getIdentities()) || [];
|
||||
this.whoami = whoami ?? (ids.length ? ids[0] : undefined);
|
||||
this.ids = ids;
|
||||
await this.load_channels();
|
||||
}
|
||||
|
||||
async load_channels() {
|
||||
let channels = await tfrpc.rpc.query(`
|
||||
SELECT
|
||||
content ->> 'channel' AS channel,
|
||||
@ -192,6 +195,14 @@ class TfElement extends LitElement {
|
||||
`,
|
||||
[JSON.stringify(this.following), id]
|
||||
);
|
||||
for (let message of messages) {
|
||||
if (message.author == this.whoami) {
|
||||
let content = JSON.parse(message.content);
|
||||
if (content?.type == 'channel') {
|
||||
this.load_channels();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (messages && messages.length) {
|
||||
this.unread = [...this.unread, ...messages];
|
||||
this.unread = this.unread.slice(this.unread.length - 1024);
|
||||
|
Reference in New Issue
Block a user