Merge pull request #727 from chandiwalaaadhar/fix/crash-on-pasting-hex-without-#-prefix

Fix-Crash on Entering Primary Color Hex Code without # Prefix
This commit is contained in:
Amruth Pillai
2022-03-18 09:24:54 +01:00
committed by GitHub
@@ -19,7 +19,7 @@ const Theme = () => {
const { background, text, primary } = useAppSelector<ThemeType>((state) => get(state.resume, 'metadata.theme'));
const handleChange = (property: string, color: string) => {
dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color }));
dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color[0] !== '#' ? `#${color}` : color }));
};
return (