From 2d4197b6f0f1140ea6ff8f12350d67656a77620c Mon Sep 17 00:00:00 2001 From: Bailey Townsend Date: Tue, 6 Jan 2026 16:41:49 -0600 Subject: [PATCH] toLowerCase() on handle queries and mod label --- index.html | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6130288..59a6a4a 100644 --- a/index.html +++ b/index.html @@ -143,11 +143,11 @@ } } } else { - this.handle = this.identifier; + this.handle = this.identifier.toLowerCase(); let data; try { data = await window.slingshot('com.bad-example.identity.resolveMiniDoc', { - params: { identifier: this.identifier }, + params: { identifier: this.identifier.toLowerCase() }, }); this.did = data.did; this.pds = data.pds; @@ -567,6 +567,33 @@ this.loading = false; }, })); + + Alpine.data('modLabels', (did) => ({ + loading: false, + error: null, + labels: [], + + async init() { + this.loading = true; + this.error = null; + this.labels = []; + try { + const res = await fetch(`https://mod.bsky.app/xrpc/com.atproto.label.queryLabels?uriPatterns=${did}`); + if (res.ok) { + const response = await res.json(); + if (response.labels && response.labels.length > 0) { + this.labels = response.labels; + } + } else { + this.error = `${res.status}: ${await res.text()}`; + } + } catch (e) { + this.error = 'failed to get labels from mod.bsky.app'; + console.error(e); + } + this.loading = false; + }, + })); }) @@ -1015,6 +1042,64 @@ + + -- 2.51.2