Fix error thrown when renderinging without a value
This commit is contained in:
@@ -29,6 +29,11 @@ export default function Offline({ logs = [], config }: OfflineProps) {
|
|||||||
const { streamKey, rtmpServerPort } = serverConfig;
|
const { streamKey, rtmpServerPort } = serverConfig;
|
||||||
const instanceUrl = global.window?.location.hostname || '';
|
const instanceUrl = global.window?.location.hostname || '';
|
||||||
|
|
||||||
|
let rtmpURL;
|
||||||
|
if (instanceUrl && rtmpServerPort) {
|
||||||
|
rtmpURL = generateStreamURL(instanceUrl, rtmpServerPort);
|
||||||
|
}
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
{
|
{
|
||||||
icon: <BookTwoTone twoToneColor="#6f42c1" />,
|
icon: <BookTwoTone twoToneColor="#6f42c1" />,
|
||||||
@@ -47,9 +52,11 @@ export default function Offline({ logs = [], config }: OfflineProps) {
|
|||||||
<Text strong className="stream-info-label">
|
<Text strong className="stream-info-label">
|
||||||
Streaming URL:
|
Streaming URL:
|
||||||
</Text>
|
</Text>
|
||||||
|
{rtmpURL && (
|
||||||
<Paragraph className="stream-info-box" copyable>
|
<Paragraph className="stream-info-box" copyable>
|
||||||
{generateStreamURL(instanceUrl, rtmpServerPort)}
|
{rtmpURL}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
|
)}
|
||||||
<Text strong className="stream-info-label">
|
<Text strong className="stream-info-label">
|
||||||
Stream Key:
|
Stream Key:
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
Reference in New Issue
Block a user