diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/nostrlogin.js | 19 | ||||
| -rw-r--r-- | src/i18n.js | 4 |
2 files changed, 10 insertions, 13 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'))) diff --git a/src/i18n.js b/src/i18n.js index ab3315d..2409c13 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -628,10 +628,6 @@ const STR = { nlDesc: 'Open the same wallet on any device — with Google, a passkey, or your Nostr account.', nlExtension: 'Use browser extension', nlGoogle: 'Sign in with Google', - nlGoogleStatus_checking: 'Checking your account…', - nlGoogleStatus_splitting: 'Creating your key (split across signers)…', - nlGoogleStatus_registering: 'Registering with signers…', - nlGoogleStatus_connecting: 'Connecting…', nlPasskey: 'Sign in with a passkey', nlPasskeyNone: 'No passkey was used. Create one for this wallet?', nlPasskeyCreate: 'Create passkey', |
