From 116acbf759e797ce8a462b26b3bd011017887851 Mon Sep 17 00:00:00 2001 From: fluid-design-io <2216991777@qq.com> Date: Wed, 18 Oct 2023 00:00:20 -0500 Subject: [PATCH] fix: type errors --- apps/web/store/store.ts | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/apps/web/store/store.ts b/apps/web/store/store.ts index dd163cc..08aa458 100644 --- a/apps/web/store/store.ts +++ b/apps/web/store/store.ts @@ -61,13 +61,16 @@ let localAndUrlStore = (set, get) => ({ state.colorPalettes.gray = grayPalette; }), ); - const { colorPalettes } = get(); - updateCSSVariables({ - primary: type === "primary" ? newPalette : colorPalettes.primary, - secondary: type === "secondary" ? newPalette : colorPalettes.secondary, - accent: type === "accent" ? newPalette : colorPalettes.accent, - gray: grayPalette, - }); + const { colorPalettes, baseColors } = get(); + updateCSSVariables( + { + primary: type === "primary" ? newPalette : colorPalettes.primary, + secondary: type === "secondary" ? newPalette : colorPalettes.secondary, + accent: type === "accent" ? newPalette : colorPalettes.accent, + gray: grayPalette, + }, + baseColors, + ); }, generatePalette: (existing = false) => { const newBaseColors = existing ? get().baseColors : generateBaseColors(); @@ -95,12 +98,16 @@ let localAndUrlStore = (set, get) => ({ }; }), ); - updateCSSVariables({ - primary: primaryPalette, - secondary: secondaryPalette, - accent: accentPalette, - gray: grayPalette, - }); + const { baseColors } = get(); + updateCSSVariables( + { + primary: primaryPalette, + secondary: secondaryPalette, + accent: accentPalette, + gray: grayPalette, + }, + baseColors, + ); }, });