Monday-Morning / project-tahiti

The repository for the Client Application of Monday Morning, the official student media body of NIT Rourkela.
https://project-tahiti-staging.onrender.com/
MIT License
74 stars 35 forks source link

bug(dark-theme): persist user selected mode #454

Open 120EE0692 opened 1 year ago

120EE0692 commented 1 year ago

Describe the bug

Currently user theme is not persisting. When the user chooses either the dark or light mode and subsequently refreshes the page, the theme reverts back to the default setting.

The synchronization of tabs is not in place, meaning that if the user switches to dark mode in one tab, the other tabs will not reflect the change.

rutajdash commented 1 year ago

Currently user theme is not persisting. When the user chooses either the dark or light mode and subsequently refreshes the page, the theme reverts back to the default setting. Consider the use of a service worker or some kind of global state library for this. Or maybe even persist the information in cookies or local storage.

The synchronization of tabs is not in place, meaning that if the user switches to dark mode in one tab, the other tabs will not reflect the change. To my knowledge, since each tab essentially is running a completely separate and detached instance of the application, this cannot be synced in real time, but each instance should be able to fetch the updated variable on refresh.