Skip to content

Commit

Permalink
fix: theme cannot be switched (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
suemor233 authored Oct 26, 2024
1 parent 284f303 commit d5be028
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/renderer/src/modules/settings/tabs/apperance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SelectTrigger,
SelectValue,
} from "@follow/components/ui/select/index.jsx"
import { useIsDark, useSetTheme, useThemeAtomValue } from "@follow/hooks"
import { useIsDark, useThemeAtomValue } from "@follow/hooks"
import { IN_ELECTRON } from "@follow/shared/constants"
import { getOS } from "@follow/utils/utils"
import { useTranslation } from "react-i18next"
Expand All @@ -18,6 +18,7 @@ import {
useUISettingValue,
} from "~/atoms/settings/ui"
import { isElectronBuild } from "~/constants"
import { useSetTheme } from "~/hooks/common"

import { SettingTabbedSegment } from "../control"
import { createDefineSettingItem } from "../helper/builder"
Expand Down
5 changes: 1 addition & 4 deletions packages/hooks/src/useSyncTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export const useSyncThemeWebApp = () => {
export const internal_useSetTheme = () =>
// eslint-disable-next-line react-hooks/rules-of-hooks
useCallback((theme: ColorMode) => jotaiStore.set(themeAtom, theme), [])
export const useSetTheme = () =>
useCallback((colorMode: ColorMode) => {
jotaiStore.set(themeAtom, colorMode)
}, [])

export function disableTransition(disableTransitionExclude: string[] = []) {
const css = document.createElement("style")
css.append(
Expand Down

0 comments on commit d5be028

Please sign in to comment.