Fix error thrown when renderinging without a value

This commit is contained in:
Gabe Kangas
2022-03-07 16:28:19 -08:00
parent ebe5558d58
commit e44f175350

View File

@@ -29,6 +29,11 @@ export default function Offline({ logs = [], config }: OfflineProps) {
const { streamKey, rtmpServerPort } = serverConfig;
const instanceUrl = global.window?.location.hostname || '';
let rtmpURL;
if (instanceUrl && rtmpServerPort) {
rtmpURL = generateStreamURL(instanceUrl, rtmpServerPort);
}
const data = [
{
icon: <BookTwoTone twoToneColor="#6f42c1" />,
@@ -47,9 +52,11 @@ export default function Offline({ logs = [], config }: OfflineProps) {
<Text strong className="stream-info-label">
Streaming URL:
</Text>
<Paragraph className="stream-info-box" copyable>
{generateStreamURL(instanceUrl, rtmpServerPort)}
</Paragraph>
{rtmpURL && (
<Paragraph className="stream-info-box" copyable>
{rtmpURL}
</Paragraph>
)}
<Text strong className="stream-info-label">
Stream Key:
</Text>