Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

Refactored- Avoiding modifying the prop

Aadhar Chandiwalae4950728d8b4
diff --git a/client/components/build/RightSidebar/sections/Theme.tsx b/client/components/build/RightSidebar/sections/Theme.tsx
index 7f0966d0d..80e731080 100644
--- a/client/components/build/RightSidebar/sections/Theme.tsx
+++ b/client/components/build/RightSidebar/sections/Theme.tsx
@@ -19,10 +19,7 @@ const Theme = () => {
const { background, text, primary } = useAppSelector<ThemeType>((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 }));
+ dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color[0] !== '#' ? `#${color}` : color }));
};
return (