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

Fix initialState useDarkLight in loggedinbutton.jsx #247

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

PaoloDiBello
Copy link
Contributor

Resolved the issue where the light mode button was incorrectly displayed upon hovering over the avatar in light mode. Adjusted the code to now show the dark mode button as expected when hovering over the avatar. This commit addresses the problem reported in issue #245.

Resolved the issue where the light mode button was incorrectly displayed upon hovering over the avatar in light mode. Adjusted the code to now show the dark mode button as expected when hovering over the avatar. This commit addresses the problem reported in [issue rgerum#245](rgerum#245).
@PaoloDiBello
Copy link
Contributor Author

PaoloDiBello commented Nov 13, 2023

Sorry @rgerum, I think my last fix didn't properly address the problem, but I think this will do it.
Initially, document.body.dataset.theme is undefined, so this condition typeof document !== "undefined" was not enough.

This might fix it:

-typeof document !== "undefined" ? document.body.dataset.theme : "light"
+document?.body?.dataset?.theme || "light",

Resolved the issue where the light mode button was incorrectly displayed upon hovering over the avatar in light mode. Adjusted the code to now show the dark mode button as expected when hovering over the avatar. This commit addresses the problem reported in [Issue rgerum#245](rgerum#245).
@rgerum rgerum merged commit 76644e0 into rgerum:master Nov 13, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants