TheOpenInnovator / Productivity-Tracker

This is a Productivity Tracker for users to use on a daily basis to keep a track of their time & tasks and to improve their Productivity.
https://theopeninnovator.github.io/Productivity-Tracker/
MIT License
6 stars 9 forks source link

Dark Mode Setting Not Persisting After Page Refresh #13

Closed Sakyasekhar closed 22 hours ago

Sakyasekhar commented 2 days ago

When a user enables dark mode, the website switches to the dark theme as expected. However, the dark mode setting does not persist after a page refresh, causing the site to revert back to the default light mode. This behavior affects user experience, as users need to re-enable dark mode after each refresh.

Steps to Reproduce:

  1. Navigate to the website.
  2. Enable dark mode using the toggle switch.
  3. Refresh the page.
  4. Observe that the site reverts back to light mode instead of retaining the dark mode setting.

Expected Behavior:
The dark mode setting should be remembered even after a page refresh, so the website remains in dark mode if it was enabled previously.

Actual Behavior:
The website resets to light mode on page refresh, regardless of the user’s previous dark mode selection.

Suggested Solution:
Store the dark mode preference in the user's local storage or cookies. On page load, check for the stored preference and apply the appropriate theme based on the saved setting.

Request:
@TheOpenInnovator , could you please assign this issue to me? I would be happy to work on it and implement the solution.

TheOpenInnovator commented 1 day ago

Hey @Sakyasekhar The issue has been assigned to you. You can start working on it.

Sakyasekhar commented 1 day ago

@TheOpenInnovator I have made the PR, please check it.

Sakyasekhar commented 23 hours ago

Hi @TheOpenInnovator,

Thank you for assigning the issue to me. I have already submitted a pull request (PR), but it seems that after my PR, another PR from @Mukku27 was merged, which also addresses the dark mode issue and has caused conflicts with my PR.

I’ve resolved the conflicts and updated my PR, but I wanted to make sure you’re aware of the situation before proceeding.

Looking forward to your guidance on how we should move forward. Thanks again!

TheOpenInnovator commented 22 hours ago

Hey @Sakyasekhar We have something for you under the PR #16 . Please do check and hope you start working on it.

Sakyasekhar commented 22 hours ago

@TheOpenInnovator , I fixed it just now, check it out.

TheOpenInnovator commented 22 hours ago

Congratulations @Sakyasekhar Your PR has been merged.