diff --git a/apps/ssb.json b/apps/ssb.json index cbe66dbd..9160fa7b 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&bOxvDG3eea4JQU+BddiS5bmAsaEZHqZdVpzpGJJxEn8=.sha256" + "previous": "&D/qe/rryIyx9bNbsyuNvsYJt1H7b28iWxR65Ql2lF5Q=.sha256" } diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index 280c263f..d5466b68 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -11,6 +11,7 @@ class TfProfileElement extends LitElement { id: {type: String}, users: {type: Object}, size: {type: Number}, + sequence: {type: Number}, following: {type: Boolean}, blocking: {type: Boolean}, }; @@ -26,6 +27,7 @@ class TfProfileElement extends LitElement { this.id = null; this.users = {}; this.size = 0; + this.sequence = 0; } async load() { @@ -170,11 +172,12 @@ class TfProfileElement extends LitElement { let profile = this.users[this.id] || {}; tfrpc.rpc .query( - `SELECT SUM(LENGTH(content)) AS size FROM messages WHERE author = ?`, + `SELECT SUM(LENGTH(content)) AS size, MAX(sequence) AS sequence FROM messages WHERE author = ?`, [this.id] ) .then(function (result) { self.size = result[0].size; + self.sequence = result[0].sequence; }); let edit; let follow; @@ -245,7 +248,7 @@ class TfProfileElement extends LitElement { let description = this.editing?.description ?? profile.description; return html`
-

(${tfutils.human_readable_size(this.size)})

+

(${tfutils.human_readable_size(this.size)} in ${this.sequence} messages)