diff --git a/index.html b/index.html index 6e72703..7e03301 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@
+ @@ -146,6 +147,7 @@ description: null, accounts: [], accountsComplete: false, + version: null, async init() { await this.update(pds); @@ -156,6 +158,14 @@ this.error = null; this.description = null; this.accounts = []; + this.accountsComplete = false; + this.version = null; + + if (!pds) { + this.loadingDesc = false; + return; + } + let query = window.SimpleQuery(pds); try { this.description = await query('com.atproto.server.describeServer'); @@ -167,10 +177,22 @@ console.error(e); } } + let health + try { + health = await query('_health'); + this.version = health.version; + } catch (e) { + if (window.isXrpcErr(e)) { + this.error = e.error; + } else { + this.error = 'Failed to reach (see console)'; + console.error(e); + } + } let accountsRes; try { accountsRes = await query('com.atproto.sync.listRepos', { - params: { limit: 7 }, + params: { limit: 100 }, }); this.accounts = accountsRes.repos; this.accountsComplete == !accountsRes.cursor; @@ -272,6 +294,32 @@ this.loading = false; }, })); + + Alpine.data('didToHandle', did => ({ + loading: false, + error: null, + handle: null, + async load() { + loading = true; + error = null; + handle = null; + let data; + try { + data = await window.slingshot('com.bad-example.identity.resolveMiniDoc', { + params: { identifier: did }, + }); + this.handle = data.handle; + } catch (e) { + if (window.isXrpcErr(e)) { + this.error = e.error; + } else { + this.error = 'failed (see console)'; + console.error(e); + } + } + loading = false; + } + })) }) @@ -341,59 +389,87 @@Loading…
-| Open registration | -- |