fix: cmdk not changing theme if active theme is custom-theme (#1842)

This commit is contained in:
Dakshesh Jain 2023-08-11 16:16:20 +05:30 committed by GitHub
parent 88e987b902
commit abec46a725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,8 @@ import { useTheme } from "next-themes";
import { SettingIcon } from "components/icons";
import userService from "services/user.service";
import useUser from "hooks/use-user";
// helper
import { unsetCustomCssVariables } from "helpers/theme.helper";
type Props = {
setIsPaletteOpen: Dispatch<SetStateAction<boolean>>;
@ -22,6 +24,8 @@ export const ChangeInterfaceTheme: React.FC<Props> = ({ setIsPaletteOpen }) => {
const updateUserTheme = (newTheme: string) => {
if (!user) return;
unsetCustomCssVariables();
setTheme(newTheme);
mutateUser((prevData) => {