Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to prevent user from closing Cockpit during video record #533

Merged

Conversation

rafaellehmkuhl
Copy link
Member

This is the best we can do for now. Chrome (as most other browsers) do not allow us anymore to set a custom message on the tab-closing alert.

With this patch, it's very unlikely that the user will make the same mistake twice.

A better solution for the future would be to save the recording direct to the user's drive, instead of the memory. I don't know if that's possible or not.

Screen.Recording.2023-10-24.at.16.22.17.mp4

Fix #518


// Try to prevent user from closing Cockpit when a stream is being recorded
watch(isRecording, () => {
if (isRecording.value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend doing the reverse logic with early return with onbeforeunload

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@patrickelectric patrickelectric merged commit 4e6b7bb into bluerobotics:master Oct 26, 2023
6 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the warn-before-close branch October 26, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants