forked from Kieran/zap.stream
Merge pull request 'profile fixes' (#18) from verbiricha/stream:profile into main
Reviewed-on: Kieran/stream#18
This commit is contained in:
commit
05bf4cbfa6
@ -1,8 +1,8 @@
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
RequestBuilder,
|
||||
ReplaceableNoteStore,
|
||||
FlatNoteStore,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
NostrLink,
|
||||
EventKind,
|
||||
parseZap,
|
||||
@ -24,20 +24,19 @@ export function useProfile(link: NostrLink, leaveOpen = false) {
|
||||
return b;
|
||||
}, [link, leaveOpen]);
|
||||
|
||||
const { data: streamsData } = useRequestBuilder<ReplaceableNoteStore>(
|
||||
System,
|
||||
ReplaceableNoteStore,
|
||||
sub
|
||||
);
|
||||
|
||||
const streams = Array.isArray(streamsData)
|
||||
? streamsData
|
||||
: streamsData
|
||||
? [streamsData]
|
||||
: [];
|
||||
const { data: streamsData } =
|
||||
useRequestBuilder<ParameterizedReplaceableNoteStore>(
|
||||
System,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
sub
|
||||
);
|
||||
const streams = streamsData ?? [];
|
||||
|
||||
const addresses = useMemo(() => {
|
||||
return streams.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`);
|
||||
if (streamsData) {
|
||||
return streamsData.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`);
|
||||
}
|
||||
return [];
|
||||
}, [streamsData]);
|
||||
|
||||
const zapsSub = useMemo(() => {
|
||||
|
@ -3,8 +3,11 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.profile-page .profile-container {
|
||||
max-width: 620px;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.profile-page .profile-container {
|
||||
width: 620px;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-page .profile-content {
|
||||
|
@ -69,8 +69,7 @@ export function ProfilePage() {
|
||||
|
||||
function goToLive() {
|
||||
if (liveEvent) {
|
||||
const d =
|
||||
liveEvent.tags?.find((t: string[]) => t?.at(0) === "d")?.at(1) || "";
|
||||
const d = findTag(liveEvent, "d") || "";
|
||||
const naddr = encodeTLV(
|
||||
NostrPrefix.Address,
|
||||
d,
|
||||
|
Loading…
Reference in New Issue
Block a user