diff options
| author | Adam Soltys <[email protected]> | 2026-08-26 22:34:42 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-26 22:34:42 -0700 |
| commit | b11e3b50483ae254caccebe220275863eb762a47 (patch) | |
| tree | 6a13aed3aa26c3904088b69bb4e0dceb274bfff2 /src/features | |
| parent | 742f4c3d9fad94d0dbb86889351d0ff506d00699 (diff) | |
| download | coinosv3-b11e3b50483ae254caccebe220275863eb762a47.tar.gz coinosv3-b11e3b50483ae254caccebe220275863eb762a47.zip | |
The Google button keeps its own counsel: no flickering narration beneath it — just a quiet spinner in place of the label while the popup does the talking
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/nostrlogin.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/features/nostrlogin.js b/src/features/nostrlogin.js index ac991c8..981491e 100644 --- a/src/features/nostrlogin.js +++ b/src/features/nostrlogin.js @@ -221,18 +221,20 @@ export function nostrLoginFeature(ctx) { async function googleLogin(run) { const popup = window.open('about:blank', 'OAuth', 'width=600,height=600'); ui.nostrLoginError = ''; + // no status narration — a quiet spinner on the button itself is the whole + // story (the popup is where anything needing the user's eyes happens) + ui.nostrLoginVia = 'google'; + busy(true); try { const pome = await import('../pomegranate.js'); - const { uri } = await pome.loginWithGoogle(popup, { - onStatus: (s) => { ui.nostrLoginStatus = t('nlGoogleStatus_' + s); render(); }, - }); - ui.nostrLoginStatus = ''; + const { uri } = await pome.loginWithGoogle(popup); await run(() => bunkerSigner(uri, { onAuth: (url) => { ui.nostrLoginAuthUrl = url; render(); } })); } catch (e) { try { popup && popup.close(); } catch {} - ui.nostrLoginStatus = ''; ui.nostrLoginError = e.message; - render(); + } finally { + ui.nostrLoginVia = null; + busy(false); } } @@ -281,9 +283,8 @@ export function nostrLoginFeature(ctx) { const pad = big ? 'padding:14px' : ''; return [ h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, - onClick: () => googleLogin(run) }, markedLabel(GOOGLE_MARK, t('nlGoogle'))), - ui.nostrLoginStatus ? h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, - h('span', { class: 'spinner sm' }), h('span', { class: 'small muted' }, ui.nostrLoginStatus)) : null, + onClick: () => googleLogin(run) }, + ui.nostrLoginVia === 'google' ? h('span', { class: 'spinner sm' }) : markedLabel(GOOGLE_MARK, t('nlGoogle'))), hasPasskey ? h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, onClick: () => passkeyLogin(run) }, markedLabel(PASSKEY_MARK, t('nlPasskey'))) |
