force type=file if livestream disabled

This commit is contained in:
zeppi 2021-04-12 12:26:45 -04:00 committed by Thomas Zarebczan
parent 0e2a7e0997
commit 9b6ffa404b
No known key found for this signature in database
GPG key ID: D505010BDB4364BC

View file

@ -122,6 +122,7 @@ function PublishForm(props: Props) {
isLivestreamClaim, isLivestreamClaim,
isPostClaim, isPostClaim,
permanentUrl, permanentUrl,
} = props;
const { replace, location } = useHistory(); const { replace, location } = useHistory();
const urlParams = new URLSearchParams(location.search); const urlParams = new URLSearchParams(location.search);
@ -370,7 +371,7 @@ function PublishForm(props: Props) {
useEffect(() => { useEffect(() => {
updatePublishForm({ updatePublishForm({
isMarkdownPost: mode === PUBLISH_MODES.POST, isMarkdownPost: mode === PUBLISH_MODES.POST,
isLivestreamPublish: isLivestreamMode, isLivestreamPublish: mode === PUBLISH_MODES.LIVESTREAM,
}); });
}, [mode, updatePublishForm]); }, [mode, updatePublishForm]);
@ -409,14 +410,19 @@ function PublishForm(props: Props) {
} }
// LiveStream publish // LiveStream publish
if (_uploadType === PUBLISH_MODES.LIVESTREAM.toLowerCase() && livestreamEnabled) { if (_uploadType === PUBLISH_MODES.LIVESTREAM.toLowerCase() && livestreamEnabled) {
setMode(PUBLISH_MODES.LIVESTREAM); if (enableLivestream) {
setMode(PUBLISH_MODES.LIVESTREAM);
} else {
setMode(PUBLISH_MODES.FILE);
}
return; return;
} }
// Default to standard file publish // Default to standard file publish
setMode(PUBLISH_MODES.FILE); setMode(PUBLISH_MODES.FILE);
}, [uploadType, livestreamEnabled]); }, [uploadType, enableLivestream]);
// if we have a type urlparam, update it? necessary?
useEffect(() => { useEffect(() => {
if (!uploadType) return; if (!uploadType) return;
const newParams = new URLSearchParams(); const newParams = new URLSearchParams();