Skip to content

fix: move update-native-theme into ipcRenderer useEffect #1009

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

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

setchy
Copy link
Member

@setchy setchy commented Apr 15, 2024

I've been seeing the following warning/error in the console when running locally

(node:7668) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 update-native-theme listeners added to [IpcRenderer]. Use emitter.setMaxListeners() to increase limit

Moving this into the useEffect along with the other ipcRenderer calls seems to alleviate this. Tested by toggling theme within the Gitify app, as well as via the macOS system settings and all seemed to behave as anticipated.

@setchy setchy added this to the Release 5.3.0 milestone Apr 15, 2024
@setchy setchy added the bug Something isn't working label Apr 15, 2024
Copy link
Member

@afonsojramos afonsojramos left a comment

Choose a reason for hiding this comment

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

That makes sense

@afonsojramos afonsojramos changed the title fix: update-native-theme listeners fix: move update-native-theme into useEffect Apr 16, 2024
@afonsojramos afonsojramos changed the title fix: move update-native-theme into useEffect fix: move update-native-theme into ipcRenderer useEffect Apr 16, 2024
@afonsojramos afonsojramos merged commit da2bf1c into main Apr 16, 2024
11 checks passed
@afonsojramos afonsojramos deleted the fix/update-native-theme-listener branch April 16, 2024 13:30
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

Successfully merging this pull request may close these issues.

2 participants