From d9bcea518b4e616d066ea0b26dd299295b8966e8 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 29 Sep 2023 11:03:33 +0100 Subject: [PATCH] Fix selected goal --- src/element/nostr-provider-dialog.tsx | 1 + src/element/stream-editor.tsx | 10 +++++----- src/providers/index.ts | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/element/nostr-provider-dialog.tsx b/src/element/nostr-provider-dialog.tsx index 5aca5a5..b9a366d 100644 --- a/src/element/nostr-provider-dialog.tsx +++ b/src/element/nostr-provider-dialog.tsx @@ -190,6 +190,7 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP ["title", info.streamInfo?.title ?? ""], ["summary", info.streamInfo?.summary ?? ""], ["image", info.streamInfo?.image ?? ""], + ...(info.streamInfo?.goal ? [["goal", info.streamInfo.goal]] : []), ...(info.streamInfo?.content_warning ? [["content-warning", info.streamInfo?.content_warning]] : []), ...(info.streamInfo?.tags?.map(a => ["t", a]) ?? []), ], diff --git a/src/element/stream-editor.tsx b/src/element/stream-editor.tsx index 3710300..516136e 100644 --- a/src/element/stream-editor.tsx +++ b/src/element/stream-editor.tsx @@ -36,11 +36,11 @@ function GoalSelector({ goal, pubkey, onGoalSelect }: GoalSelectorProps) { const goals = useGoals(pubkey, true); const { formatMessage } = useIntl(); return ( - onGoalSelect(ev.target.value)}> - {goals?.map(goal => ( - ))} @@ -57,7 +57,7 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) { const [tags, setTags] = useState([]); const [contentWarning, setContentWarning] = useState(false); const [isValid, setIsValid] = useState(false); - const [goal, setGoal] = useState(); + const [goal, setGoal] = useState(); const login = useLogin(); const { formatMessage } = useIntl(); diff --git a/src/providers/index.ts b/src/providers/index.ts index 7dd3e14..c713eee 100644 --- a/src/providers/index.ts +++ b/src/providers/index.ts @@ -69,8 +69,9 @@ export interface StreamProviderStreamInfo { title: string; summary: string; image: string; - tags: Array; - content_warning: string; + tags?: Array; + content_warning?: string; + goal?: string; } export const DefaultProvider = new Nip103StreamProvider("zap.stream", "https://api.zap.stream/api/nostr/");