fix: cmdk not changing theme if active theme is custom-theme (#1842)
This commit is contained in:
parent
88e987b902
commit
abec46a725
1 changed files with 4 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ import { useTheme } from "next-themes";
|
||||||
import { SettingIcon } from "components/icons";
|
import { SettingIcon } from "components/icons";
|
||||||
import userService from "services/user.service";
|
import userService from "services/user.service";
|
||||||
import useUser from "hooks/use-user";
|
import useUser from "hooks/use-user";
|
||||||
|
// helper
|
||||||
|
import { unsetCustomCssVariables } from "helpers/theme.helper";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
setIsPaletteOpen: Dispatch<SetStateAction<boolean>>;
|
setIsPaletteOpen: Dispatch<SetStateAction<boolean>>;
|
||||||
|
|
@ -22,6 +24,8 @@ export const ChangeInterfaceTheme: React.FC<Props> = ({ setIsPaletteOpen }) => {
|
||||||
const updateUserTheme = (newTheme: string) => {
|
const updateUserTheme = (newTheme: string) => {
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
|
|
||||||
|
unsetCustomCssVariables();
|
||||||
|
|
||||||
setTheme(newTheme);
|
setTheme(newTheme);
|
||||||
|
|
||||||
mutateUser((prevData) => {
|
mutateUser((prevData) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue