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,
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();