mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 06:55:51 +01:00
🐛 Color theme not working when opening customize page from board page
This commit is contained in:
@@ -33,23 +33,9 @@ export const ConfigProvider = ({
|
||||
);
|
||||
const [configVersion, setConfigVersion] = useState(0);
|
||||
const { configs } = useConfigStore((s) => ({ configs: s.configs }), shallow);
|
||||
const { setPrimaryColor, setSecondaryColor, setPrimaryShade } = useColorTheme();
|
||||
|
||||
const currentConfig = configs.find((c) => c.value.configProperties.name === configName)?.value;
|
||||
|
||||
useEffect(() => {
|
||||
const config = currentConfig ?? fallbackConfig;
|
||||
if (!config) return;
|
||||
setPrimaryColor(config?.settings.customization.colors.primary ?? 'red');
|
||||
setSecondaryColor(config?.settings.customization.colors.secondary ?? 'orange');
|
||||
setPrimaryShade(config?.settings.customization.colors.shade ?? 6);
|
||||
return () => {
|
||||
setPrimaryColor('red');
|
||||
setSecondaryColor('orange');
|
||||
setPrimaryShade(6);
|
||||
};
|
||||
}, [currentConfig]);
|
||||
|
||||
return (
|
||||
<ConfigContext.Provider
|
||||
value={{
|
||||
|
||||
@@ -66,6 +66,18 @@ function App(
|
||||
setPrimaryShade,
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log('running page props stuff');
|
||||
setPrimaryColor(props.pageProps.primaryColor ?? 'red');
|
||||
setSecondaryColor(props.pageProps.secondaryColor ?? 'orange');
|
||||
setPrimaryShade(props.pageProps.primaryShade ?? 6);
|
||||
return () => {
|
||||
setPrimaryColor('red');
|
||||
setSecondaryColor('orange');
|
||||
setPrimaryShade(6);
|
||||
};
|
||||
}, [props.pageProps]);
|
||||
|
||||
const { setInitialPackageAttributes } = usePackageAttributesStore();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user