mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Use APP_RELAYS as nostrconnect fallback
When the user has no NIP-65 write relays configured, getRelayUrls() was building the nostrconnect:// URI with a single relay (wss://relay.ditto.pub). Fall back to the full APP_RELAYS write list instead so the remote signer has more connection options during the handshake. Extract the default relay list into src/lib/appRelays.ts as a single source of truth, shared between App.tsx (defaultConfig) and useLoginActions.ts (nostrconnect fallback).
This commit is contained in:
3 files changed
+23
-9
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
useNostrLogin,
|
||||
} from '@nostrify/react/login';
|
||||
import { useAppContext } from '@/hooks/useAppContext';
|
||||
import { APP_RELAYS } from '@/lib/appRelays';
|
||||
|
||||
// NOTE: This file should not be edited except for adding new login methods.
|
||||
|
||||
@@ -51,7 +52,11 @@ export function useLoginActions() {
|
||||
const relays = config.relayMetadata.relays
|
||||
.filter((r) => r.write)
|
||||
.map((r) => r.url);
|
||||
return relays.length > 0 ? relays : ['wss://relay.ditto.pub'];
|
||||
// Fall back to the app default relays if the user has none configured,
|
||||
// so the remote signer has multiple connection options during handshake.
|
||||
return relays.length > 0
|
||||
? relays
|
||||
: APP_RELAYS.relays.filter((r) => r.write).map((r) => r.url);
|
||||
},
|
||||
// Log out the current user
|
||||
async logout(): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user