Edit dummy event if none set

This commit is contained in:
2023-07-05 23:39:40 +01:00
parent 61c981b220
commit 7971f7154a

View File

@ -1,8 +1,12 @@
import { NostrEvent } from "@snort/system";
import { StreamProvider, StreamProviderInfo } from "providers";
import { useEffect, useState } from "react";
import { SendZaps } from "./send-zap";
import { StreamEditor, StreamEditorProps } from "./stream-editor";
import Spinner from "./spinner";
import { LIVE_STREAM } from "const";
const DummyEvent = { content: "", id: "", pubkey: "", sig: "", kind: LIVE_STREAM, created_at: 0, tags: [] } as NostrEvent;
export function NostrProviderDialog({ provider, ...others }: { provider: StreamProvider } & StreamEditorProps) {
const [topup, setTopup] = useState(false);
@ -35,7 +39,7 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP
}} />
}
const streamEvent = others.ev ?? info.publishedEvent;
const streamEvent = others.ev ?? info.publishedEvent ?? DummyEvent;
return <>
<div>
<p>Stream Url</p>