-
Notifications
You must be signed in to change notification settings - Fork 762
Confirm closing game in prod #2397
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
Conversation
|
Warning Rate limit exceeded@ryanbarlow97 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 8 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe PR enhances browser lifecycle event handling in the client by adding a development-mode guard to the beforeunload handler to prevent unintended page navigation when games are active, and introducing a pagehide handler to gracefully stop games when the page becomes hidden. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Suggested reviewers
Poem
Pre-merge checks✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| event.returnValue = ""; | ||
| return event.returnValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why these lines are necessary?
| this.publicLobby = document.querySelector("public-lobby") as PublicLobby; | ||
|
|
||
| window.addEventListener("beforeunload", () => { | ||
| window.addEventListener("beforeunload", (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
singpleplayer has a beforeunload hook to save the game, so just want to make sure they don't conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When clicking the exit button in game, there is a prompt, will this cause duplicate prompts?
|
This pull request is stale because it has been open for fourteen days with no activity. If you want to keep this pull request open, add a comment or update the branch. |
|
This pull request is stale because it has been open for fourteen days with no activity. If you want to keep this pull request open, add a comment or update the branch. |
|
@voloder Are you still interested in finishing this PR up? |
|
Stale PR that is now orphaned. If anyone wants to pick this up, feel free! |
I opened PR #2777. It's up-to-date with latest changes to main and takes a completely different approach. |
Amazing, I'll close this down |
Description:
After accidentally pressing the back button on my mouse mid game, I got frustrated with the fact that there's no confirmation before the game closes abruptly
In this PR I have added confirmation, but only when the user is in an active game. It's disabled in dev mode to prevent annoyances with hot reload and debugging.
I hope this PR helps someone.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
ado1928