A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: some rocksky element changes

+28 -11
+6 -2
src/components/supplement/rocksky/element.js
··· 109 109 */ 110 110 async signIn() { 111 111 const did = localStorage.getItem(ATPROTO_DID_KEY); 112 - if (!did) throw new Error("rocksky: no AT Protocol session found"); 112 + if (!did) { 113 + console.warn("Rocksky: No AT Protocol session found"); 114 + return; 115 + } 113 116 114 117 this.#isAuthenticating.set(true); 118 + 115 119 try { 116 120 const session = await getSession( 117 121 /** @type {`did:${string}:${string}`} */ (did), ··· 124 128 }); 125 129 this.#setSession(data.session); 126 130 } catch (err) { 127 - console.warn("rocksky: failed to authenticate", err); 131 + console.warn("Rocksky: Failed to authenticate", err); 128 132 throw err; 129 133 } finally { 130 134 this.#isAuthenticating.set(false);
+9 -7
src/facets/misc/scrobble/rocksky/index.html
··· 34 34 <div id="state-connect"> 35 35 <div id="state-no-atproto"> 36 36 <p>Sign in with your AT Protocol identity first, then connect to Rocksky.</p> 37 - <label>Handle <input id="handle-input" placeholder="you.bsky.social" /></label> 38 - <p class="button-row"> 39 - <button id="atproto-sign-in-btn"> 40 - <i class="ph-bold ph-at"></i> 41 - Sign in with AT Protocol 42 - </button> 43 - </p> 37 + <form id="atproto-sign-in-form"> 38 + <label>Handle <input id="handle-input" placeholder="you.bsky.social" /></label> 39 + <p class="button-row"> 40 + <button id="atproto-sign-in-btn"> 41 + <i class="ph-bold ph-at"></i> 42 + Sign in with AT Protocol 43 + </button> 44 + </p> 45 + </form> 44 46 </div> 45 47 46 48 <div id="state-has-atproto" hidden>
+13 -2
src/facets/misc/scrobble/rocksky/index.inline.js
··· 120 120 121 121 // @ts-ignore 122 122 signInBtn.disabled = isAuthenticating; 123 + signInBtn.querySelector("i").className = isAuthenticating 124 + ? "ph-bold ph-spinner animate-spin" 125 + : "ph-bold ph-plugs"; 126 + 123 127 // @ts-ignore 124 128 atprotoSignInBtn.disabled = isAuthenticating; 129 + atprotoSignInBtn.querySelector("i").className = isAuthenticating 130 + ? "ph-bold ph-spinner animate-spin" 131 + : "ph-bold ph-at"; 125 132 }); 126 133 127 134 //////////////////////////////////////////// 128 135 // ACTIONS 129 136 //////////////////////////////////////////// 130 137 131 - atprotoSignInBtn.onclick = async () => { 138 + const atprotoSignInForm = /** @type {HTMLFormElement} */ ( 139 + document.querySelector("#atproto-sign-in-form") 140 + ); 141 + 142 + atprotoSignInForm.onsubmit = async (e) => { 143 + e.preventDefault(); 132 144 const handle = handleInput.value?.trim(); 133 145 if (!handle) return; 134 146 await login(handle); 135 147 }; 136 148 137 149 signInBtn.onclick = () => rocksky.signIn().catch(() => {}); 138 - 139 150 signOutBtn.onclick = () => rocksky.signOut(); 140 151 141 152 ////////////////////////////////////////////