From 5bfcd858da5e18c6b232465d2a35f2d2e4728a6e Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Sat, 23 Dec 2023 16:53:14 +0200 Subject: [PATCH] get profiles from ndk --- packages/app/src/Element/Embed/CashuNuts.tsx | 4 ++-- packages/app/src/Element/Embed/Mention.tsx | 4 ++-- packages/app/src/Element/Event/NoteFooter.tsx | 4 ++-- packages/app/src/Element/Event/NoteReaction.tsx | 4 ++-- packages/app/src/Element/Event/Poll.tsx | 4 ++-- packages/app/src/Element/Event/ZapButton.tsx | 4 ++-- packages/app/src/Element/Invite.tsx | 4 ++-- .../app/src/Element/IrisAccount/ActiveAccount.tsx | 4 ++-- packages/app/src/Element/Nip5Service.tsx | 4 ++-- packages/app/src/Element/User/DisplayName.tsx | 2 +- packages/app/src/Element/User/Nip05.tsx | 4 ++-- packages/app/src/Element/User/ProfileLink.tsx | 5 +++-- packages/app/src/Element/User/ProfilePreview.tsx | 9 +++++---- packages/app/src/Element/User/Username.tsx | 4 ++-- packages/app/src/Pages/Layout/Footer.tsx | 4 ++-- packages/app/src/Pages/Layout/NavSidebar.tsx | 4 ++-- .../app/src/Pages/Notifications/Notifications.tsx | 5 +++-- packages/app/src/Pages/Profile/ProfilePage.tsx | 11 ++--------- packages/app/src/Pages/ZapPool.tsx | 4 ++-- packages/app/src/Pages/settings/Profile.tsx | 4 ++-- packages/app/src/SnortUtils/index.ts | 3 +-- packages/app/src/Tasks/TaskList.tsx | 4 ++-- 22 files changed, 47 insertions(+), 52 deletions(-) diff --git a/packages/app/src/Element/Embed/CashuNuts.tsx b/packages/app/src/Element/Embed/CashuNuts.tsx index 55686c3e..2d12544f 100644 --- a/packages/app/src/Element/Embed/CashuNuts.tsx +++ b/packages/app/src/Element/Embed/CashuNuts.tsx @@ -1,10 +1,10 @@ import "./CashuNuts.css"; import { useEffect, useState } from "react"; import { FormattedMessage, FormattedNumber } from "react-intl"; -import { useUserProfile } from "@snort/system-react"; import useLogin from "@/Hooks/useLogin"; import Icon from "@/Icons/Icon"; +import useProfile from "@/Hooks/useProfile"; interface Token { token: Array<{ @@ -18,7 +18,7 @@ interface Token { export default function CashuNuts({ token }: { token: string }) { const { publicKey } = useLogin(s => ({ publicKey: s.publicKey })); - const profile = useUserProfile(publicKey); + const profile = useProfile(publicKey); async function copyToken(e: React.MouseEvent, token: string) { e.stopPropagation(); diff --git a/packages/app/src/Element/Embed/Mention.tsx b/packages/app/src/Element/Embed/Mention.tsx index 51c8961b..e2d8194d 100644 --- a/packages/app/src/Element/Embed/Mention.tsx +++ b/packages/app/src/Element/Embed/Mention.tsx @@ -1,13 +1,13 @@ import { NostrLink, NostrPrefix } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; import DisplayName from "@/Element/User/DisplayName"; import { ProfileCard } from "@/Element/User/ProfileCard"; import { ProfileLink } from "@/Element/User/ProfileLink"; import { useCallback, useRef, useState } from "react"; +import useProfile from "@/Hooks/useProfile"; export default function Mention({ link }: { link: NostrLink }) { - const profile = useUserProfile(link.id); + const profile = useProfile(link.id); const [isHovering, setIsHovering] = useState(false); const hoverTimeoutRef = useRef(null); diff --git a/packages/app/src/Element/Event/NoteFooter.tsx b/packages/app/src/Element/Event/NoteFooter.tsx index d9e24caa..99c0e790 100644 --- a/packages/app/src/Element/Event/NoteFooter.tsx +++ b/packages/app/src/Element/Event/NoteFooter.tsx @@ -3,7 +3,7 @@ import { FormattedMessage, useIntl } from "react-intl"; import { useLongPress } from "use-long-press"; import { TaggedNostrEvent, ParsedZap, countLeadingZeros, NostrLink } from "@snort/system"; import { normalizeReaction } from "@snort/shared"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import { Menu, MenuItem } from "@szhsin/react-menu"; import classNames from "classnames"; @@ -53,7 +53,7 @@ export default function NoteFooter(props: NoteFooterProps) { preferences: prefs, readonly, } = useLogin(s => ({ preferences: s.appData.item.preferences, publicKey: s.publicKey, readonly: s.readonly })); - const author = useUserProfile(ev.pubkey); + const author = useProfile(ev.pubkey); const interactionCache = useInteractionCache(publicKey, ev.id); const { publisher, system } = useEventPublisher(); const note = useNoteCreator(n => ({ show: n.show, replyTo: n.replyTo, update: n.update, quote: n.quote })); diff --git a/packages/app/src/Element/Event/NoteReaction.tsx b/packages/app/src/Element/Event/NoteReaction.tsx index a1cfd396..6dfc80f1 100644 --- a/packages/app/src/Element/Event/NoteReaction.tsx +++ b/packages/app/src/Element/Event/NoteReaction.tsx @@ -8,7 +8,7 @@ import { eventLink, hexToBech32, getDisplayName } from "@/SnortUtils"; import useModeration from "@/Hooks/useModeration"; import { FormattedMessage } from "react-intl"; import Icon from "@/Icons/Icon"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import { useInView } from "react-intersection-observer"; export interface NoteReactionProps { @@ -20,7 +20,7 @@ export default function NoteReaction(props: NoteReactionProps) { const { data: ev } = props; const { isMuted } = useModeration(); const { inView, ref } = useInView({ triggerOnce: true, rootMargin: "2000px" }); - const profile = useUserProfile(inView ? ev.pubkey : ""); + const profile = useProfile(inView ? ev.pubkey : ""); const refEvent = useMemo(() => { if (ev) { diff --git a/packages/app/src/Element/Event/Poll.tsx b/packages/app/src/Element/Event/Poll.tsx index 931f02a1..2e920e5a 100644 --- a/packages/app/src/Element/Event/Poll.tsx +++ b/packages/app/src/Element/Event/Poll.tsx @@ -2,7 +2,7 @@ import { TaggedNostrEvent, ParsedZap, NostrLink } from "@snort/system"; import { LNURL } from "@snort/shared"; import { useState } from "react"; import { FormattedMessage, FormattedNumber, useIntl } from "react-intl"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import useEventPublisher from "@/Hooks/useEventPublisher"; import { useWallet } from "@/Wallet"; @@ -28,7 +28,7 @@ export default function Poll(props: PollProps) { publicKey: myPubKey, relays, } = useLogin(s => ({ preferences: s.appData.item.preferences, publicKey: s.publicKey, relays: s.relays })); - const pollerProfile = useUserProfile(props.ev.pubkey); + const pollerProfile = useProfile(props.ev.pubkey); const [tallyBy, setTallyBy] = useState("pubkeys"); const [error, setError] = useState(""); const [invoice, setInvoice] = useState(""); diff --git a/packages/app/src/Element/Event/ZapButton.tsx b/packages/app/src/Element/Event/ZapButton.tsx index c14dc88e..753c624a 100644 --- a/packages/app/src/Element/Event/ZapButton.tsx +++ b/packages/app/src/Element/Event/ZapButton.tsx @@ -1,7 +1,7 @@ import "./ZapButton.css"; import { useState } from "react"; import { HexKey } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import SendSats from "@/Element/SendSats"; import Icon from "@/Icons/Icon"; @@ -18,7 +18,7 @@ const ZapButton = ({ children?: React.ReactNode; event?: string; }) => { - const profile = useUserProfile(pubkey); + const profile = useProfile(pubkey); const [zap, setZap] = useState(false); const service = lnurl ?? (profile?.lud16 || profile?.lud06); if (!service) return null; diff --git a/packages/app/src/Element/Invite.tsx b/packages/app/src/Element/Invite.tsx index 676735e3..aab2429c 100644 --- a/packages/app/src/Element/Invite.tsx +++ b/packages/app/src/Element/Invite.tsx @@ -1,6 +1,6 @@ import SnortApi from "@/External/SnortApi"; import { getCurrentRefCode, getDisplayName } from "@/SnortUtils"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import Lottie from "lottie-react"; import { useState, useEffect } from "react"; import { FormattedMessage } from "react-intl"; @@ -18,7 +18,7 @@ const InviteModal = () => { api.getRefCodeInfo(code).then(a => setPubkey(a.pubkey)); } }, []); - const profile = useUserProfile(pubkey); + const profile = useProfile(pubkey); if (!code) return; function close() { diff --git a/packages/app/src/Element/IrisAccount/ActiveAccount.tsx b/packages/app/src/Element/IrisAccount/ActiveAccount.tsx index f46c9add..343d0666 100644 --- a/packages/app/src/Element/IrisAccount/ActiveAccount.tsx +++ b/packages/app/src/Element/IrisAccount/ActiveAccount.tsx @@ -1,5 +1,5 @@ import { mapEventToProfile } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import AccountName from "./AccountName"; import useLogin from "@/Hooks/useLogin"; @@ -12,7 +12,7 @@ export default function ActiveAccount({ name = "", setAsPrimary = () => {} }) { publicKey: s.publicKey, readonly: s.readonly, })); - const profile = useUserProfile(publicKey); + const profile = useProfile(publicKey); const { publisher, system } = useEventPublisher(); async function saveProfile(nip05: string) { diff --git a/packages/app/src/Element/Nip5Service.tsx b/packages/app/src/Element/Nip5Service.tsx index d49487b1..84705166 100644 --- a/packages/app/src/Element/Nip5Service.tsx +++ b/packages/app/src/Element/Nip5Service.tsx @@ -17,7 +17,7 @@ import { import AsyncButton from "@/Element/Button/AsyncButton"; import SendSats from "@/Element/SendSats"; import Copy from "@/Element/Copy"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import useEventPublisher from "@/Hooks/useEventPublisher"; import { debounce } from "@/SnortUtils"; import useLogin from "@/Hooks/useLogin"; @@ -43,7 +43,7 @@ export default function Nip5Service(props: Nip05ServiceProps) { const { helpText = true } = props; const { formatMessage } = useIntl(); const { publicKey } = useLogin(s => ({ publicKey: s.publicKey })); - const user = useUserProfile(publicKey); + const user = useProfile(publicKey); const { publisher, system } = useEventPublisher(); const svc = useMemo(() => new ServiceProvider(props.service), [props.service]); const [serviceConfig, setServiceConfig] = useState(); diff --git a/packages/app/src/Element/User/DisplayName.tsx b/packages/app/src/Element/User/DisplayName.tsx index 5523abc0..1e3f9c77 100644 --- a/packages/app/src/Element/User/DisplayName.tsx +++ b/packages/app/src/Element/User/DisplayName.tsx @@ -4,7 +4,7 @@ import { HexKey } from "@snort/system"; import { getDisplayNameOrPlaceHolder } from "@/SnortUtils"; import classNames from "classnames"; import useProfile from "@/Hooks/useProfile"; -import {NDKUserProfile} from "@nostr-dev-kit/ndk"; +import { NDKUserProfile } from "@nostr-dev-kit/ndk"; interface DisplayNameProps { pubkey: HexKey; diff --git a/packages/app/src/Element/User/Nip05.tsx b/packages/app/src/Element/User/Nip05.tsx index be43cee5..1261a972 100644 --- a/packages/app/src/Element/User/Nip05.tsx +++ b/packages/app/src/Element/User/Nip05.tsx @@ -1,9 +1,9 @@ import "./Nip05.css"; import { HexKey } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/Hooks/useProfile"; export function useIsVerified(pubkey?: HexKey, bypassCheck?: boolean) { - const profile = useUserProfile(pubkey); + const profile = useProfile(pubkey); return { isVerified: bypassCheck || profile?.isNostrAddressValid }; } diff --git a/packages/app/src/Element/User/ProfileLink.tsx b/packages/app/src/Element/User/ProfileLink.tsx index a157e3c6..5d566e3a 100644 --- a/packages/app/src/Element/User/ProfileLink.tsx +++ b/packages/app/src/Element/User/ProfileLink.tsx @@ -1,8 +1,9 @@ import { ReactNode, useContext } from "react"; import { Link, LinkProps } from "react-router-dom"; -import { UserMetadata, NostrLink, NostrPrefix, MetadataCache } from "@snort/system"; +import { NostrLink, NostrPrefix } from "@snort/system"; import { SnortContext } from "@snort/system-react"; import { randomSample } from "@/SnortUtils"; +import { NDKUserProfile } from "@nostr-dev-kit/ndk"; export function ProfileLink({ pubkey, @@ -12,7 +13,7 @@ export function ProfileLink({ ...others }: { pubkey: string; - user?: UserMetadata | MetadataCache; + user?: NDKUserProfile; explicitLink?: string; children?: ReactNode; } & Omit) { diff --git a/packages/app/src/Element/User/ProfilePreview.tsx b/packages/app/src/Element/User/ProfilePreview.tsx index 0e3911ac..3f28ea5f 100644 --- a/packages/app/src/Element/User/ProfilePreview.tsx +++ b/packages/app/src/Element/User/ProfilePreview.tsx @@ -1,11 +1,12 @@ import "./ProfilePreview.css"; import { ReactNode } from "react"; -import { HexKey, UserMetadata } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import { HexKey } from "@snort/system"; import { useInView } from "react-intersection-observer"; import ProfileImage from "@/Element/User/ProfileImage"; import FollowButton from "@/Element/User/FollowButton"; +import useProfile from "@/Hooks/useProfile"; +import { NDKUserProfile } from "@nostr-dev-kit/ndk"; export interface ProfilePreviewProps { pubkey: HexKey; @@ -14,7 +15,7 @@ export interface ProfilePreviewProps { linkToProfile?: boolean; profileCards?: boolean; }; - profile?: UserMetadata; + profile?: NDKUserProfile; actions?: ReactNode; className?: string; onClick?: (e: React.MouseEvent) => void; @@ -22,7 +23,7 @@ export interface ProfilePreviewProps { export default function ProfilePreview(props: ProfilePreviewProps) { const pubkey = props.pubkey; const { ref, inView } = useInView({ triggerOnce: true }); - const user = useUserProfile(inView ? pubkey : undefined); + const user = useProfile(inView ? pubkey : undefined); const options = { about: true, ...props.options, diff --git a/packages/app/src/Element/User/Username.tsx b/packages/app/src/Element/User/Username.tsx index cf83257c..fdf55fc5 100644 --- a/packages/app/src/Element/User/Username.tsx +++ b/packages/app/src/Element/User/Username.tsx @@ -1,11 +1,11 @@ import { HexKey } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import { ProfileLink } from "./ProfileLink"; import DisplayName from "./DisplayName"; export default function Username({ pubkey, onLinkVisit }: { pubkey: HexKey; onLinkVisit(): void }) { - const user = useUserProfile(pubkey); + const user = useProfile(pubkey); return user ? ( diff --git a/packages/app/src/Pages/Layout/Footer.tsx b/packages/app/src/Pages/Layout/Footer.tsx index c075ec6f..1f7c469c 100644 --- a/packages/app/src/Pages/Layout/Footer.tsx +++ b/packages/app/src/Pages/Layout/Footer.tsx @@ -5,7 +5,7 @@ import Icon from "@/Icons/Icon"; import { ProfileLink } from "@/Element/User/ProfileLink"; import { NoteCreatorButton } from "@/Element/Event/Create/NoteCreatorButton"; import classNames from "classnames"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import Avatar from "@/Element/User/Avatar"; import { useIntl } from "react-intl"; @@ -37,7 +37,7 @@ const Footer = () => { publicKey: s.publicKey, readonly: s.readonly, })); - const profile = useUserProfile(publicKey); + const profile = useProfile(publicKey); const { formatMessage } = useIntl(); const readOnlyIcon = readonly && ( diff --git a/packages/app/src/Pages/Layout/NavSidebar.tsx b/packages/app/src/Pages/Layout/NavSidebar.tsx index 95a435b3..9020d25d 100644 --- a/packages/app/src/Pages/Layout/NavSidebar.tsx +++ b/packages/app/src/Pages/Layout/NavSidebar.tsx @@ -4,7 +4,7 @@ import Icon from "@/Icons/Icon"; import { ProfileLink } from "../../Element/User/ProfileLink"; import Avatar from "../../Element/User/Avatar"; import useLogin from "../../Hooks/useLogin"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import { NoteCreatorButton } from "../../Element/Event/Create/NoteCreatorButton"; import { FormattedMessage, useIntl } from "react-intl"; import classNames from "classnames"; @@ -78,7 +78,7 @@ export default function NavSidebar({ narrow = false }) { subscriptions: s.subscriptions, readonly: s.readonly, })); - const profile = useUserProfile(publicKey); + const profile = useProfile(publicKey); const navigate = useNavigate(); const { publisher } = useEventPublisher(); const sub = getCurrentSubscription(subscriptions); diff --git a/packages/app/src/Pages/Notifications/Notifications.tsx b/packages/app/src/Pages/Notifications/Notifications.tsx index fad6075e..86901839 100644 --- a/packages/app/src/Pages/Notifications/Notifications.tsx +++ b/packages/app/src/Pages/Notifications/Notifications.tsx @@ -2,7 +2,7 @@ import "./Notifications.css"; import { Suspense, lazy, useEffect, useMemo, useState, useSyncExternalStore } from "react"; import { EventExt, EventKind, NostrEvent, NostrLink, NostrPrefix, TaggedNostrEvent, parseZap } from "@snort/system"; import { unwrap } from "@snort/shared"; -import { useEventFeed, useUserProfile } from "@snort/system-react"; +import { useEventFeed } from "@snort/system-react"; import { useInView } from "react-intersection-observer"; import { FormattedMessage, useIntl } from "react-intl"; import { useNavigate } from "react-router-dom"; @@ -20,6 +20,7 @@ import { LiveEvent } from "@/Element/LiveEvent"; import ProfilePreview from "@/Element/User/ProfilePreview"; import { ShowMoreInView } from "@/Element/Event/ShowMore"; import PageSpinner from "@/Element/PageSpinner"; +import useProfile from "@/Hooks/useProfile"; const NotificationGraph = lazy(() => import("@/Pages/Notifications/NotificationChart")); function notificationContext(ev: TaggedNostrEvent) { @@ -133,7 +134,7 @@ function NotificationGroup({ evs, onClick }: { evs: Array; onC }), ); const firstPubkey = pubkeys[0]; - const firstPubkeyProfile = useUserProfile(inView ? (firstPubkey === "anon" ? "" : firstPubkey) : ""); + const firstPubkeyProfile = useProfile(inView ? (firstPubkey === "anon" ? "" : firstPubkey) : ""); const context = notificationContext(evs[0]); const totalZaps = zaps.reduce((acc, v) => acc + v.amount, 0); diff --git a/packages/app/src/Pages/Profile/ProfilePage.tsx b/packages/app/src/Pages/Profile/ProfilePage.tsx index 4463d804..e7c45fbe 100644 --- a/packages/app/src/Pages/Profile/ProfilePage.tsx +++ b/packages/app/src/Pages/Profile/ProfilePage.tsx @@ -2,14 +2,7 @@ import "./ProfilePage.css"; import { useEffect, useState } from "react"; import { FormattedMessage } from "react-intl"; import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; -import { - encodeTLVEntries, - EventKind, - NostrLink, - NostrPrefix, - TLVEntryType, - tryParseNostrLink, -} from "@snort/system"; +import { encodeTLVEntries, EventKind, NostrLink, NostrPrefix, TLVEntryType, tryParseNostrLink } from "@snort/system"; import { fetchNip05Pubkey, LNURL } from "@snort/shared"; import { findTag, getLinkReactions, hexToBech32, parseId, unwrap } from "@/SnortUtils"; @@ -55,7 +48,7 @@ import { UserWebsiteLink } from "@/Element/User/UserWebsiteLink"; import { useMuteList, usePinList } from "@/Hooks/useLists"; import FollowedBy from "@/Element/User/FollowedBy"; import useProfile from "@/Hooks/useProfile"; -import {NDKUserProfile} from "@nostr-dev-kit/ndk"; +import { NDKUserProfile } from "@nostr-dev-kit/ndk"; interface ProfilePageProps { id?: string; diff --git a/packages/app/src/Pages/ZapPool.tsx b/packages/app/src/Pages/ZapPool.tsx index d52b3193..2ed3908a 100644 --- a/packages/app/src/Pages/ZapPool.tsx +++ b/packages/app/src/Pages/ZapPool.tsx @@ -2,7 +2,7 @@ import "./ZapPool.css"; import { useMemo, useSyncExternalStore } from "react"; import { FormattedMessage, FormattedNumber } from "react-intl"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import { SnortPubKey } from "@/Const"; import ProfilePreview from "@/Element/User/ProfilePreview"; @@ -24,7 +24,7 @@ const DataProviders = [ export function ZapPoolTarget({ target }: { target: ZapPoolRecipient }) { if (!ZapPoolController) return; const login = useLogin(); - const profile = useUserProfile(target.pubkey); + const profile = useProfile(target.pubkey); const hasAddress = profile?.lud16 || profile?.lud06; const defaultZapMount = Math.ceil(login.appData.item.preferences.defaultZapAmount * (target.split / 100)); return ( diff --git a/packages/app/src/Pages/settings/Profile.tsx b/packages/app/src/Pages/settings/Profile.tsx index 0078ebb4..c5b51f00 100644 --- a/packages/app/src/Pages/settings/Profile.tsx +++ b/packages/app/src/Pages/settings/Profile.tsx @@ -2,7 +2,7 @@ import "./Profile.css"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import { mapEventToProfile } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import useEventPublisher from "@/Hooks/useEventPublisher"; import { openFile, debounce } from "@/SnortUtils"; @@ -27,7 +27,7 @@ export default function ProfileSettings(props: ProfileSettingsProps) { const navigate = useNavigate(); const { formatMessage } = useIntl(); const { publicKey: id, readonly } = useLogin(s => ({ publicKey: s.publicKey, readonly: s.readonly })); - const user = useUserProfile(id ?? ""); + const user = useProfile(id ?? ""); const { publisher, system } = useEventPublisher(); const uploader = useFileUpload(); const [error, setError] = useState(); diff --git a/packages/app/src/SnortUtils/index.ts b/packages/app/src/SnortUtils/index.ts index a6e36fed..720e491b 100644 --- a/packages/app/src/SnortUtils/index.ts +++ b/packages/app/src/SnortUtils/index.ts @@ -16,12 +16,11 @@ import { NostrEvent, MetadataCache, NostrLink, - UserMetadata, } from "@snort/system"; import { isHex, isOffline } from "@snort/shared"; import { Birthday, Day } from "@/Const"; import AnimalName from "@/Element/User/AnimalName"; -import {NDKUser, NDKUserProfile} from "@nostr-dev-kit/ndk"; +import { NDKUserProfile } from "@nostr-dev-kit/ndk"; export const sha256 = (str: string | Uint8Array): u256 => { return utils.bytesToHex(hash(str)); diff --git a/packages/app/src/Tasks/TaskList.tsx b/packages/app/src/Tasks/TaskList.tsx index b932d991..a2674975 100644 --- a/packages/app/src/Tasks/TaskList.tsx +++ b/packages/app/src/Tasks/TaskList.tsx @@ -1,6 +1,6 @@ import "./TaskList.css"; import { Fragment, useSyncExternalStore } from "react"; -import { useUserProfile } from "@snort/system-react"; +import useProfile from "@/hooks/useProfile"; import useLogin from "@/Hooks/useLogin"; import Icon from "@/Icons/Icon"; @@ -38,7 +38,7 @@ class TaskStore extends ExternalStore> { const AllTasks = new TaskStore(); export const TaskList = () => { const session = useLogin(); - const user = useUserProfile(session.publicKey); + const user = useProfile(session.publicKey); const tasks = useSyncExternalStore( c => AllTasks.hook(c), () => AllTasks.snapshot(),