fix: theme cannot be switched (#1157)
This commit is contained in:
parent
284f3032b1
commit
d5be0287ad
|
|
@ -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"
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue