Skip to content

Conversation

@vekkele
Copy link
Contributor

@vekkele vekkele commented Dec 30, 2025

Summary

For now night-mode saving doesn't work properly for anon user since we have server-side check for night mode in user settings and setting body class after that. It leads to desync between useUiCtx state and visual (body class) page appearance.

Another problem is saving in local storage leads to white page blink

Fixes:

  1. Save night mode setting in cookies instead of local storage to ensure proper retrieving user preference on server (during handle hook).
  2. Check for user preferences in single place (handle hook) instead of both hook and useUiCtx
  3. Preference check now checking for currentUser settings and cookies. I removed checking for body class since there is no document on the server
  4. Fix copy button border in ShareDialog

Notion card

https://www.notion.so/santiment/Fix-night-mode-bugs-2d12a82d1361804e8fa6c61d0dc685d6?source=copy_link

@vekkele vekkele self-assigned this Dec 30, 2025
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