diff --git a/README.md b/README.md index 554e3bc01..451182a08 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ I would recomend you use a browser extension like [Alby](https://getalby.com/) o - [x] [NIP-25](https://github.com/nostr-protocol/nips/blob/master/25.md): Reactions - [ ] [NIP-26](https://github.com/nostr-protocol/nips/blob/master/26.md): Delegated Event Signing - [ ] [NIP-33](https://github.com/nostr-protocol/nips/blob/master/33.md): Parameterized Replaceable Events +- [ ] [NIP-39](https://github.com/nostr-protocol/nips/blob/master/39.md): External Identities in Profiles - [ ] [NIP-36](https://github.com/nostr-protocol/nips/blob/master/36.md): Sensitive Content - [ ] [NIP-40](https://github.com/nostr-protocol/nips/blob/master/40.md): Expiration Timestamp - [ ] [NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md): Authentication of clients to relays diff --git a/src/views/user/notes.tsx b/src/views/user/notes.tsx index 1c9cf5859..04c6c29ce 100644 --- a/src/views/user/notes.tsx +++ b/src/views/user/notes.tsx @@ -22,15 +22,21 @@ import { RelayMode } from "../../classes/relay"; import { RelayIcon } from "../../components/icons"; import { Note } from "../../components/note"; import { isNote } from "../../helpers/nostr-event"; +import { useReadRelayUrls } from "../../hooks/use-client-relays"; import useFallbackUserRelays from "../../hooks/use-fallback-user-relays"; -import useRankedRelayConfigs from "../../hooks/use-ranked-relay-configs"; import { useTimelineLoader } from "../../hooks/use-timeline-loader"; +import relayScoreboardService from "../../services/relay-scoreboard"; const UserNotesTab = () => { const { pubkey } = useOutletContext() as { pubkey: string }; - const userRelays = useFallbackUserRelays(pubkey).filter((r) => r.mode & RelayMode.WRITE); - const ranked = useRankedRelayConfigs(userRelays); - const relays = ranked.map((r) => r.url).slice(0, 4) as string[]; + // get user relays + const userRelays = useFallbackUserRelays(pubkey) + .filter((r) => r.mode & RelayMode.WRITE) + .map((r) => r.url); + // merge the users relays with client relays + const mergedRelays = useReadRelayUrls(userRelays); + // find the top 4 + const relays = relayScoreboardService.getRankedRelays(mergedRelays).slice(0, 4); const { isOpen: showReplies, onToggle: toggleReplies } = useDisclosure();