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