fix: stream editor

closes #180
This commit is contained in:
kieran 2024-09-17 11:27:32 +01:00
parent 645d04cd5c
commit f23c97fa0e
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
2 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,7 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) {
} else if (gameId) {
new GameDatabase().getGame(gameId).then(setGame);
}
}, [ev?.id]);
}, []);
const validate = useCallback(() => {
if (title.length < 2) {

View File

@ -101,6 +101,7 @@ export interface StreamInfo {
title?: string;
summary?: string;
image?: string;
thumbnail?: string;
status?: StreamState;
stream?: string;
recording?: string;
@ -132,6 +133,7 @@ export function extractStreamInfo(ev?: NostrEvent) {
matchTag(t, "title", v => (ret.title = v));
matchTag(t, "summary", v => (ret.summary = v));
matchTag(t, "image", v => (ret.image = v));
matchTag(t, "thumbnail", v => (ret.thumbnail = v));
matchTag(t, "status", v => (ret.status = v as StreamState));
if (t[0] === "streaming" && t[1].startsWith("http")) {
matchTag(t, "streaming", v => (ret.stream = v));