diff --git a/apps/ssb.json b/apps/ssb.json index 525408c6..43cfe60e 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&20LHLqRX51iuC74SlJ+u76sH9cyptDyuR3/bkqE4yhA=.sha256" + "previous": "&vne+VDF5TCAlv/9HqNIt5Zgkf+WNwwm+XiG/xwlBrnk=.sha256" } diff --git a/apps/ssb/app.js b/apps/ssb/app.js index 50f08066..d86c8303 100644 --- a/apps/ssb/app.js +++ b/apps/ssb/app.js @@ -21,9 +21,6 @@ tfrpc.register(async function createIdentity() { tfrpc.register(async function getServerIdentity() { return ssb.getServerIdentity(); }); -tfrpc.register(async function setServerFollowingMe(id, following) { - return ssb.setServerFollowingMe(id, following); -}); tfrpc.register(async function getIdentities() { return ssb.getIdentities(); }); diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index 04cc00c5..08c900e7 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -11,7 +11,6 @@ class TfProfileElement extends LitElement { id: {type: String}, users: {type: Object}, size: {type: Number}, - server_follows_me: {type: Boolean}, following: {type: Boolean}, blocking: {type: Boolean}, }; @@ -27,7 +26,6 @@ class TfProfileElement extends LitElement { this.id = null; this.users = {}; this.size = 0; - this.server_follows_me = undefined; } async load() { @@ -63,26 +61,6 @@ class TfProfileElement extends LitElement { } } - async initial_load() { - this.server_follows_me = undefined; - let server_id = await tfrpc.rpc.getServerIdentity(); - let followed = await tfrpc.rpc.query( - ` - SELECT json_extract(content, '$.following') AS following - FROM messages - WHERE author = ? AND - json_extract(content, '$.type') = 'contact' AND - json_extract(content, '$.contact') = ? ORDER BY sequence DESC LIMIT 1 - `, - [server_id, this.whoami] - ); - let is_followed = false; - for (let row of followed) { - is_followed = row.following != 0; - } - this.server_follows_me = is_followed; - } - modify(change) { tfrpc.rpc .appendMessage( @@ -175,31 +153,11 @@ class TfProfileElement extends LitElement { input.click(); } - async server_follow_me(follow) { - try { - await tfrpc.rpc.setServerFollowingMe(this.whoami, follow); - } catch (e) { - console.log(e); - } - try { - await this.initial_load(); - } catch (e) { - console.log(e); - } - } - copy_id() { navigator.clipboard.writeText(this.id); } render() { - if ( - this.id == this.whoami && - this.editing && - this.server_follows_me === undefined - ) { - this.initial_load(); - } this.load(); let self = this; let profile = this.users[this.id] || {}; @@ -216,22 +174,6 @@ class TfProfileElement extends LitElement { let block; if (this.id === this.whoami) { if (this.editing) { - let server_follow; - if (this.server_follows_me === true) { - server_follow = html``; - } else if (this.server_follows_me === false) { - server_follow = html``; - } edit = html` - ${server_follow} `; } else { edit = html`