Browse Source

Fix error thrown when renderinging without a value

pull/1886/head
Gabe Kangas 4 years ago
parent
commit
e44f175350
  1. 9
      web/components/offline-notice.tsx

9
web/components/offline-notice.tsx

@ -29,6 +29,11 @@ export default function Offline({ logs = [], config }: OfflineProps) { @@ -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) { @@ -47,9 +52,11 @@ export default function Offline({ logs = [], config }: OfflineProps) {
<Text strong className="stream-info-label">
Streaming URL:
</Text>
{rtmpURL && (
<Paragraph className="stream-info-box" copyable>
{generateStreamURL(instanceUrl, rtmpServerPort)}
{rtmpURL}
</Paragraph>
)}
<Text strong className="stream-info-label">
Stream Key:
</Text>

Loading…
Cancel
Save