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

GPThemes not overriding ChatGPT theme mode after page refresh (#48) #52

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

itsmartashub
Copy link
Owner

refactor(theme-mode-consistency): Sync GPT theme mode with GPThemes (#48)

  • Rewrite the theme manager to directly mutate the value of GPT theme in local storage, eliminating the need for storage.sync
  • Ensure that theme changes from GPT settings are now reflected in the floating theme and are in sync
  • Note: There is a small issue with dark and accent themes on the /share/* page due to overriding code

Changes summary:

  • Improved the theme management system:
    • Replaced the use of storage.sync with direct mutation of the GPT theme value in local storage, enhancing performance and reliability.
    • Ensured that theme changes from GPT settings are now properly reflected in the floating theme, maintaining a consistent user experience.
    • Identified a minor issue with dark and accent themes on the /share/* page, which will require further attention to resolve the overriding code.

)

- Rewrite the theme manager to directly mutate the value of GPT theme in local storage, eliminating the need for storage.sync
- Ensure that theme changes from GPT settings are now reflected in the floating theme and are in sync
- Note: There is a small issue with dark and accent themes on the "/share/*" page due to overriding code

Changes summary:
- Improved the theme management system:
  - Replaced the use of storage.sync with direct mutation of the GPT theme value in local storage, enhancing performance and reliability.
  - Ensured that theme changes from GPT settings are now properly reflected in the floating theme, maintaining a consistent user experience.
  - Identified a minor issue with dark and accent themes on the "/share/*" page, which will require further attention to resolve the overriding code.
@itsmartashub itsmartashub linked an issue Sep 15, 2024 that may be closed by this pull request
@itsmartashub itsmartashub self-assigned this Sep 15, 2024
… unnecessary keys that were previously used for theme management

- Remove left storage.sync keys related to theme management, as they are no longer needed with the switch to storage.local

Changes summary:
- Removed obsolete storage.sync keys:
  - Cleaned up storage by removing unnecessary keys that were previously used for theme management, ensuring a more organized and efficient storage system.
- Replace the long if statement with a more concise and readable version using Object.values(THEMES).includes(themeButtonID)

Changes summary:
- Simplified the theme button ID check:
  - Replaced a lengthy if statement with a more efficient and readable version, improving code maintainability and reducing complexity.
@itsmartashub itsmartashub merged commit 40cf991 into main Sep 16, 2024
2 checks passed
@itsmartashub itsmartashub deleted the fix/theme-mode-consistency branch October 10, 2024 11:25
@itsmartashub itsmartashub restored the fix/theme-mode-consistency branch October 10, 2024 11:25
@itsmartashub itsmartashub deleted the fix/theme-mode-consistency branch October 10, 2024 11:25
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.

GPThemes not overriding ChatGPT theme mode after page refresh
1 participant