forked from Kieran/zap.stream
Fix selected goal
This commit is contained in:
parent
11ead3e8bd
commit
d9bcea518b
@ -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]) ?? []),
|
||||
],
|
||||
|
@ -36,11 +36,11 @@ function GoalSelector({ goal, pubkey, onGoalSelect }: GoalSelectorProps) {
|
||||
const goals = useGoals(pubkey, true);
|
||||
const { formatMessage } = useIntl();
|
||||
return (
|
||||
<select defaultValue={goal} onChange={ev => onGoalSelect(ev.target.value)}>
|
||||
<select onChange={ev => onGoalSelect(ev.target.value)}>
|
||||
<option value="">{formatMessage({ defaultMessage: "Select a goal..." })}</option>
|
||||
{goals?.map(goal => (
|
||||
<option key={goal.id} value={goal.id}>
|
||||
{goal.content}
|
||||
{goals?.map(x => (
|
||||
<option key={x.id} value={x.id} selected={goal === x.id}>
|
||||
{x.content}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
@ -57,7 +57,7 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) {
|
||||
const [tags, setTags] = useState<string[]>([]);
|
||||
const [contentWarning, setContentWarning] = useState(false);
|
||||
const [isValid, setIsValid] = useState(false);
|
||||
const [goal, setGoal] = useState<string | undefined>();
|
||||
const [goal, setGoal] = useState<string>();
|
||||
const login = useLogin();
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
|
@ -69,8 +69,9 @@ export interface StreamProviderStreamInfo {
|
||||
title: string;
|
||||
summary: string;
|
||||
image: string;
|
||||
tags: Array<string>;
|
||||
content_warning: string;
|
||||
tags?: Array<string>;
|
||||
content_warning?: string;
|
||||
goal?: string;
|
||||
}
|
||||
|
||||
export const DefaultProvider = new Nip103StreamProvider("zap.stream", "https://api.zap.stream/api/nostr/");
|
||||
|
Loading…
Reference in New Issue
Block a user