mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
Fix-Crash on Entering Primary Color Hex Code without # Prefix
This commit is contained in:
@ -19,6 +19,9 @@ const Theme = () => {
|
|||||||
const { background, text, primary } = useAppSelector<ThemeType>((state) => get(state.resume, 'metadata.theme'));
|
const { background, text, primary } = useAppSelector<ThemeType>((state) => get(state.resume, 'metadata.theme'));
|
||||||
|
|
||||||
const handleChange = (property: string, color: string) => {
|
const handleChange = (property: string, color: string) => {
|
||||||
|
if (color[0] !== '#') {
|
||||||
|
color = `#${color}`;
|
||||||
|
}
|
||||||
dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color }));
|
dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user