diff --git a/ui/component/publish/shared/publishStreamReleaseDate/view.jsx b/ui/component/publish/shared/publishStreamReleaseDate/view.jsx index 8df00bce80..de8953c32a 100644 --- a/ui/component/publish/shared/publishStreamReleaseDate/view.jsx +++ b/ui/component/publish/shared/publishStreamReleaseDate/view.jsx @@ -22,7 +22,8 @@ type Props = { const PublishStreamReleaseDate = (props: Props) => { const { isScheduled, releaseTime, clock24h, appLanguage, updatePublishForm } = props; - const [publishLater, setPublishLater] = React.useState(isScheduled); + const minScheduledTimePassed = releaseTime ? releaseTime < dateToLinuxTimestamp(moment().toDate()) : undefined; + const [publishLater, setPublishLater] = React.useState(isScheduled && !minScheduledTimePassed); const getPlus30MinutesDate = () => { return moment().add('1', 'hour').add('30', 'minutes').startOf('hour').toDate(); @@ -50,14 +51,6 @@ const PublishStreamReleaseDate = (props: Props) => { 'Your scheduled streams will appear on your channel page and for your followers. Chat will not be active until 5 minutes before the start time.' ); - React.useEffect(() => { - if (isScheduled) { - // TODO: this is doPrepareEdit's responsibility, not the component's. - updatePublishForm({ releaseTime: dateToLinuxTimestamp(getPlus30MinutesDate()) }); - } - // eslint-disable-next-line react-hooks/exhaustive-deps -- on mount only - }, []); - return ( <>