default relays

This commit is contained in:
Alejandro Gomez 2023-07-08 08:16:29 +02:00
parent b75bb881b9
commit befcee6045
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
3 changed files with 21 additions and 17 deletions

View File

@ -60,21 +60,21 @@ export default function Header() {
}
}, [pubkey]);
useEffect(() => {
if (pubkey) {
pool
.get(relays, {
kinds: [RELAYS],
authors: [pubkey],
})
.then((ev) => {
const relays = ev.tags
.filter((t) => t.at(0) === "r")
.map((t) => t.at(1));
setRelays(relays);
});
}
}, [pubkey]);
//useEffect(() => {
// if (pubkey) {
// pool
// .get(relays, {
// kinds: [RELAYS],
// authors: [pubkey],
// })
// .then((ev) => {
// const relays = ev.tags
// .filter((t) => t.at(0) === "r")
// .map((t) => t.at(1));
// setRelays(relays);
// });
// }
//}, [pubkey]);
async function goToProfile() {
const url = `/p/${nip19.nprofileEncode({ pubkey, relays })}`;

View File

@ -14,7 +14,6 @@ export default function User({ pubkey, showName = true, ...rest }) {
return nip19.npubEncode(pubkey);
}
}, []);
console.log("PUBK", pubkey);
const content = (
<Stack align="center" direction="row" spacing={2}>
<Avatar

View File

@ -1,5 +1,10 @@
import { atom } from "jotai";
export const pubkeyAtom = atom();
export const relaysAtom = atom(["wss://nos.lol", "wss://nostr.wine"]);
export const relaysAtom = atom([
"wss://relay.snort.social",
"wss://relay.damus.io",
"wss://nos.lol",
"wss://nostr.wine",
]);
export const userEmojiAtom = atom();