fix: change theme settings do not work after relocated data folder #4317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
Fixes Issues
Changes made
This pull request includes several changes to the theme loading functionality in the project. The main changes involve the removal of the
janThemesPathAtom
and the introduction of a newapplyTheme
function to streamline the application of theme variables. Below are the most important changes grouped by theme.Removal of
janThemesPathAtom
:web/helpers/atoms/Setting.atom.ts
: Removed thejanThemesPathAtom
export.web/hooks/useLoadTheme.ts
: Removed references tojanThemesPathAtom
in theuseLoadTheme
hook. [1] [2] [3] [4]web/screens/Settings/Appearance/index.tsx
: Removed references tojanThemesPathAtom
and replaced it withjanDataFolderPathAtom
. [1] [2] [3]Introduction of
applyTheme
function:web/hooks/useLoadTheme.ts
: Added a newapplyTheme
function to handle the application of CSS variables for themes, replacing inline code with a function call. [1] [2] [3]These changes improve the maintainability and readability of the theme loading code by removing redundant atoms and encapsulating theme application logic within a dedicated function.