diff --git a/apps/ssb.json b/apps/ssb.json index dfee3948..bf51f3e1 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&Zm3zI6Q6mbGPnUNj1O07Fc5c71M7pME6AHk/a+pDIoA=.sha256" + "previous": "&Q5LSWQhvy1yI5rijBxN8xz9AOsDvGupiPlVVme7Rdm8=.sha256" } diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index f13ad5ce..19dec76b 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -366,6 +366,7 @@ class TfElement extends LitElement { } async load() { + let start_time = new Date(); let whoami = this.whoami; let following = await tfrpc.rpc.following([whoami], 2); let users = {}; @@ -383,7 +384,6 @@ class TfElement extends LitElement { this.channels_unread = JSON.parse( (await tfrpc.rpc.databaseGet('unread')) ?? '{}' ); - let start_time = new Date(); users = await this.fetch_about(Object.keys(following).sort(), users); console.log( 'about took', @@ -392,10 +392,9 @@ class TfElement extends LitElement { Object.keys(users).length, 'users' ); - start_time = new Date(); this.following = Object.keys(following); this.users = users; - console.log(`load finished ${whoami} => ${this.whoami}`); + console.log(`load finished ${whoami} => ${this.whoami} in ${(new Date() - start_time) / 1000}`); this.whoami = whoami; this.loaded = whoami; } @@ -448,6 +447,7 @@ class TfElement extends LitElement { .channels_latest=${this.channels_latest} .channels_unread=${this.channels_unread} @channelsetunread=${this.channel_set_unread} + .connections=${this.connections} > `; } else if (this.tab === 'connections') { diff --git a/apps/ssb/tf-tab-news.js b/apps/ssb/tf-tab-news.js index 02c65cda..8795ef14 100644 --- a/apps/ssb/tf-tab-news.js +++ b/apps/ssb/tf-tab-news.js @@ -15,6 +15,7 @@ class TfTabNewsElement extends LitElement { channels: {type: Array}, channels_unread: {type: Object}, channels_latest: {type: Object}, + connections: {type: Array}, }; } @@ -33,6 +34,7 @@ class TfTabNewsElement extends LitElement { this.channels_unread = {}; this.channels_latest = {}; this.channels = []; + this.connections = []; tfrpc.rpc.localStorageGet('drafts').then(function (d) { self.drafts = JSON.parse(d || '{}'); }); @@ -126,29 +128,7 @@ class TfTabNewsElement extends LitElement { return this.hash.startsWith('##') ? this.hash.substring(2) : undefined; } - render() { - let profile = - this.hash.startsWith('#@') && this.hash != '#@' - ? html`` - : undefined; - let edit_profile; - if ( - !this.loading && - this.users[this.whoami]?.name === undefined && - this.hash.substring(1) != this.whoami - ) { - edit_profile = html`
- ℹ️ Follow your identity link ☝️ above to edit your profile and set your - name. -
`; - } + render_sidebar() { return html`
` )} + +
Connections
+ ${this.connections.map((x) => (html` + + `))}
+ `; + } + + render() { + let profile = + this.hash.startsWith('#@') && this.hash != '#@' + ? html`` + : undefined; + let edit_profile; + if ( + !this.loading && + this.users[this.whoami]?.name === undefined && + this.hash.substring(1) != this.whoami + ) { + edit_profile = html`
+ ℹ️ Follow your identity link ☝️ above to edit your profile and set your + name. +
`; + } + return html` + ${this.render_sidebar()}
?`; let name = this.users?.[this.id]?.name; - name = - name !== undefined - ? html`${name}` - : html`${this.id}`; + name = html`${name !== undefined ? name : this.id}` if (this.users[this.id]) { let image_link = this.users[this.id].image; @@ -42,7 +39,7 @@ class TfUserElement extends LitElement { />`; } } - return html`
+ return html`
${image} ${name}
`; }