notif and qr profile link prefixes from config

This commit is contained in:
Martti Malmi 2023-11-29 15:26:44 +02:00
parent 1f82d38acb
commit d704ded3d8
2 changed files with 5 additions and 3 deletions

View File

@ -83,7 +83,9 @@ export default function NotificationsPage({ onClick }: { onClick?: (link: NostrL
const timeGrouped = useMemo(() => {
return myNotifications.reduce((acc, v) => {
const key = `${timeKey(v)}:${notificationContext(v as TaggedNostrEvent)?.encode()}:${v.kind}`;
const key = `${timeKey(v)}:${notificationContext(v as TaggedNostrEvent)?.encode(CONFIG.eventLinkPrefix)}:${
v.kind
}`;
if (acc.has(key)) {
unwrap(acc.get(key)).push(v as TaggedNostrEvent);
} else {
@ -240,7 +242,7 @@ function NotificationGroup({ evs, onClick }: { evs: Array<TaggedNostrEvent>; onC
if (onClick) {
onClick(context);
} else {
navigate(`/${context.encode()}`);
navigate(`/${context.encode(CONFIG.eventLinkPrefix)}`);
}
}}
/>

View File

@ -299,7 +299,7 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
function renderIcons() {
if (!id) return;
const link = encodeTLV(NostrPrefix.Profile, id);
const link = encodeTLV(CONFIG.profileLinkPrefix, id);
return (
<>
<IconButton onClick={() => setShowProfileQr(true)} icon={{ name: "qr", size: 16 }} />