feat: add browser dialog to prevent navigation (#962)

Switching from undefined to "" tells the browser to put in a modal which requires users to confirm thier navigation away. this will prevent continued annoyances from upload failures: https://2u-internal.atlassian.net/browse/TNL-11587
This commit is contained in:
connorhaugh
2024-04-24 11:04:12 -04:00
committed by GitHub
parent c32462e21e
commit 98138181f7

View File

@@ -85,9 +85,12 @@ const VideosPage = ({
useEffect(() => {
window.onbeforeunload = () => {
dispatch(markVideoUploadsInProgressAsFailed({ uploadingIdsRef, courseId }));
if (addVideoStatus === RequestStatus.IN_PROGRESS) {
return '';
}
return undefined;
};
}, []);
}, [addVideoStatus]);
const {
isVideoTranscriptEnabled,