force type=file if livestream disabled
This commit is contained in:
parent
0e2a7e0997
commit
9b6ffa404b
1 changed files with 9 additions and 3 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue