-
Notifications
You must be signed in to change notification settings - Fork 141
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
fix: heatmaps unload listener #1736
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR fixes an issue with the heatmaps unload listener where the flush
method was being called with an incorrect this
context, causing "undefined buffer" errors during page unload.
- Moved
beforeunload
event listener from constructor to_setupListeners()
insrc/heatmaps.ts
- Added proper
bind(this)
toflush
method in event listener to ensure correct context - Improved initialization flow by only setting up listeners when heatmaps are enabled
- Prevents potential undefined buffer access by moving listener setup out of constructor
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +110 B (0%) Total Size: 3.3 MB
ℹ️ View Unchanged
|
fixes #1735
we shouldn't be setting up listeners in the constructor anyway since we can init heatmaps and not be enabled
so, moves into the setup method, and binds this