diff --git a/apps/ssb.json b/apps/ssb.json index 1c93c446..525408c6 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&pkSGa9BIj2iuPuR8xMQQWQpZk6htin+m8y2m7VTDgG4=.sha256" + "previous": "&20LHLqRX51iuC74SlJ+u76sH9cyptDyuR3/bkqE4yhA=.sha256" } diff --git a/apps/ssb/app.js b/apps/ssb/app.js index afa58858..50f08066 100644 --- a/apps/ssb/app.js +++ b/apps/ssb/app.js @@ -106,6 +106,10 @@ tfrpc.register(async function getActiveIdentity() { tfrpc.register(async function sync() { return await ssb.sync(); }); +tfrpc.register(async function url() { + return core.url; +}); + core.register('onBroadcastsChanged', async function () { await tfrpc.rpc.set('broadcasts', await ssb.getBroadcasts()); }); diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 444dbebe..a6688609 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -18,6 +18,8 @@ class TfElement extends LitElement { channels: {type: Array}, channels_unread: {type: Object}, channels_latest: {type: Object}, + guest: {type: Boolean}, + url: {type: String}, }; } @@ -66,7 +68,9 @@ class TfElement extends LitElement { async initial_load() { let whoami = await tfrpc.rpc.getActiveIdentity(); let ids = (await tfrpc.rpc.getIdentities()) || []; + this.url = await tfrpc.rpc.url(); this.whoami = whoami ?? (ids.length ? ids[0] : undefined); + this.guest = !this.whoami?.length; this.ids = ids; await this.load_channels(); } @@ -590,7 +594,16 @@ class TfElement extends LitElement { `; let contents = - !this.loaded || this.loading + this.guest ? + html`
+

⚠️🦀 Must be logged in to Tilde Friends to scuttle here. 🦀⚠️

+ +
` + : !this.loaded || this.loading ? html`