Skip to content

Commit

Permalink
feat: add browser dialog to prevent navigation (openedx#962)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
connorhaugh authored Apr 24, 2024
1 parent c32462e commit 9813818
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/files-and-videos/videos-page/VideosPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ const VideosPage = ({
useEffect(() => {
window.onbeforeunload = () => {
dispatch(markVideoUploadsInProgressAsFailed({ uploadingIdsRef, courseId }));
if (addVideoStatus === RequestStatus.IN_PROGRESS) {
return '';
}
return undefined;
};
}, []);
}, [addVideoStatus]);

const {
isVideoTranscriptEnabled,
Expand Down

0 comments on commit 9813818

Please sign in to comment.