diff --git a/src/components/AuthModal.vue b/src/components/AuthModal.vue index 120deda..bc484f9 100644 --- a/src/components/AuthModal.vue +++ b/src/components/AuthModal.vue @@ -136,10 +136,11 @@ {{ nostrConnectLoading ? 'Waiting...' : 'Remote Signer' }} @@ -434,6 +446,7 @@ const { loginWithRemoteSigner, startRemoteSignerQrFlow, isLoading: nostrConnectLoading, + isCompletingLogin: nostrCompletingLogin, error: nostrConnectError, popupBlockedUri, } = useNostrConnect() diff --git a/src/composables/useNostrConnect.ts b/src/composables/useNostrConnect.ts index 412d0be..e158b16 100644 --- a/src/composables/useNostrConnect.ts +++ b/src/composables/useNostrConnect.ts @@ -18,6 +18,8 @@ const WAIT_FOR_SIGNER_TIMEOUT_MS = 120_000 export function useNostrConnect() { const authStore = useAuthStore() const isConnecting = ref(false) + /** True when signer has connected and we're completing login (getPubkey, create account, backend auth) */ + const isCompletingLogin = ref(false) const error = ref(null) /** When pop-up is blocked, we show a tappable link — direct user tap often bypasses blockers */ const popupBlockedUri = ref(null) @@ -88,6 +90,8 @@ export function useNostrConnect() { throw new Error('Connection was closed before the signer responded.') } + isCompletingLogin.value = true + const pubkey = await signer.getPublicKey() if (!pubkey) { throw new Error('Could not get public key from signer.') @@ -109,6 +113,7 @@ export function useNostrConnect() { throw err } finally { isConnecting.value = false + isCompletingLogin.value = false popupBlockedUri.value = null if (signer && !signer.isConnected) { signer.close().catch(() => {}) @@ -197,6 +202,7 @@ export function useNostrConnect() { return { isConnecting, + isCompletingLogin, isLoading, error, popupBlockedUri,