add bootstrap relays if ext dose not provide any

This commit is contained in:
hzrd149 2023-03-10 10:26:10 -06:00
parent 8e88656f7e
commit dbfcf14cbd
2 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@ export default function LoginNpubView() {
const navigate = useNavigate();
const toast = useToast();
const [npub, setNpub] = useState("");
const [relayUrl, setRelayUrl] = useState("");
const [relayUrl, setRelayUrl] = useState("wss://relay.damus.io");
const handleSubmit: React.FormEventHandler<HTMLDivElement> = (e) => {
e.preventDefault();

View File

@ -26,6 +26,10 @@ export default function LoginStartView() {
relays = Object.keys(extRelays).filter((url) => extRelays[url].read);
}
if (relays.length === 0) {
relays = ["wss://relay.damus.io", "wss://relay.snort.social", "wss://nostr.wine"];
}
accountService.addAccount({ pubkey, relays, useExtension: true });
}