mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
Add spinner feedback to Sign in with Nostr button while loading pubkey
This commit is contained in:
1 parent
937ac826f8
commit
de96dd4ad0
1 file changed
+37
-6
+37
-6
@@ -453,6 +453,28 @@
|
||||
border-radius: 8px;
|
||||
padding: 7px 10px;
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
|
||||
transition: opacity .15s;
|
||||
}
|
||||
|
||||
.pill:disabled {
|
||||
opacity: .7;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
.pill .spinner {
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 2px solid var(--line);
|
||||
border-top-color: var(--accent);
|
||||
border-radius: 50%;
|
||||
margin-right: 6px;
|
||||
animation: spin .55s linear infinite;
|
||||
vertical-align: -2px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.previewShell {
|
||||
@@ -4404,13 +4426,22 @@
|
||||
}
|
||||
|
||||
async function nostrLogin() {
|
||||
const pubkey = await getNostrPublicKey();
|
||||
if (!pubkey) {
|
||||
alert('No Nostr extension found. Install Alby, nos2x, or another NIP-07 extension.');
|
||||
return;
|
||||
const loginBtn = $('nostrLoginBtn');
|
||||
const orig = loginBtn.innerHTML;
|
||||
loginBtn.disabled = true;
|
||||
loginBtn.innerHTML = '<span class="spinner"></span>Sign in with Nostr';
|
||||
try {
|
||||
const pubkey = await getNostrPublicKey();
|
||||
if (!pubkey) {
|
||||
alert('No Nostr extension found. Install Alby, nos2x, or another NIP-07 extension.');
|
||||
return;
|
||||
}
|
||||
state.community.myPubkey = pubkey;
|
||||
await loadCommunityIdentity();
|
||||
} finally {
|
||||
loginBtn.disabled = false;
|
||||
loginBtn.innerHTML = orig;
|
||||
}
|
||||
state.community.myPubkey = pubkey;
|
||||
await loadCommunityIdentity();
|
||||
}
|
||||
|
||||
async function loadMyDesigns() {
|
||||
|
||||
Reference in new issue
Block a user