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

Navigation Not Blocked When Peer Active #54

Open
dallen4 opened this issue Oct 20, 2023 · 1 comment
Open

Navigation Not Blocked When Peer Active #54

dallen4 opened this issue Oct 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dallen4
Copy link
Owner

dallen4 commented Oct 20, 2023

Description

Currently, the beforeunload event is used to block navigation away from a /drop or /grab page when an active peer connection is open. This is to avoid weird UX and dropped or dangling WebRTC and WebSocket connections.

However, because of how Next.js navigates within its framework, it does not trigger the beforeunload event when navigating and thus doesn't block navigation or cleanup peer connections before leaving the page.

Solution

A blocking approaching using an event listener on Next.js' Router should be able to provide the desired functionality.

@dallen4 dallen4 added the bug Something isn't working label Oct 20, 2023
@dallen4
Copy link
Owner Author

dallen4 commented Oct 20, 2023

Comment discussing a way to intercept events and block navigation with Next.js' Router: vercel/next.js#2694 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant