From 9b6ffa404b706be9c0e5e55eb91d38e4ffc9bc3c Mon Sep 17 00:00:00 2001 From: zeppi Date: Mon, 12 Apr 2021 12:26:45 -0400 Subject: [PATCH] force type=file if livestream disabled --- ui/component/publishForm/view.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index 965fd42af..b4eabe2b6 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -122,6 +122,7 @@ function PublishForm(props: Props) { isLivestreamClaim, isPostClaim, permanentUrl, + } = props; const { replace, location } = useHistory(); const urlParams = new URLSearchParams(location.search); @@ -370,7 +371,7 @@ function PublishForm(props: Props) { useEffect(() => { updatePublishForm({ isMarkdownPost: mode === PUBLISH_MODES.POST, - isLivestreamPublish: isLivestreamMode, + isLivestreamPublish: mode === PUBLISH_MODES.LIVESTREAM, }); }, [mode, updatePublishForm]); @@ -409,14 +410,19 @@ function PublishForm(props: Props) { } // LiveStream publish if (_uploadType === PUBLISH_MODES.LIVESTREAM.toLowerCase() && livestreamEnabled) { - setMode(PUBLISH_MODES.LIVESTREAM); + if (enableLivestream) { + setMode(PUBLISH_MODES.LIVESTREAM); + } else { + setMode(PUBLISH_MODES.FILE); + } return; } // Default to standard file publish setMode(PUBLISH_MODES.FILE); - }, [uploadType, livestreamEnabled]); + }, [uploadType, enableLivestream]); + // if we have a type urlparam, update it? necessary? useEffect(() => { if (!uploadType) return; const newParams = new URLSearchParams();