From dac4e862b816b9ae6aee0dcc0c0be469d1966a9b Mon Sep 17 00:00:00 2001 From: Aadhar Chandiwala Date: Thu, 17 Mar 2022 19:42:26 +0530 Subject: [PATCH] Fix-Crash on Entering Primary Color Hex Code without # Prefix --- client/components/build/RightSidebar/sections/Theme.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/components/build/RightSidebar/sections/Theme.tsx b/client/components/build/RightSidebar/sections/Theme.tsx index af188386..7f0966d0 100644 --- a/client/components/build/RightSidebar/sections/Theme.tsx +++ b/client/components/build/RightSidebar/sections/Theme.tsx @@ -19,6 +19,9 @@ const Theme = () => { const { background, text, primary } = useAppSelector((state) => get(state.resume, 'metadata.theme')); const handleChange = (property: string, color: string) => { + if (color[0] !== '#') { + color = `#${color}`; + } dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color })); };