From 918e8b9304a0ef1a230fd050d454f1b7aee946c5 Mon Sep 17 00:00:00 2001 From: Ksathwik03 <76401429+Ksathwik03@users.noreply.github.com> Date: Thu, 21 Oct 2021 21:21:45 -0500 Subject: [PATCH] Remove null check for 'component.definition.styles (#1183) * Remove null check for 'component.definition.styles * Update Toggle.jsx * Update Toggle.jsx --- frontend/src/Editor/Components/Toggle.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Editor/Components/Toggle.jsx b/frontend/src/Editor/Components/Toggle.jsx index fcf6ed795b..15958f4901 100644 --- a/frontend/src/Editor/Components/Toggle.jsx +++ b/frontend/src/Editor/Components/Toggle.jsx @@ -37,9 +37,9 @@ export const ToggleSwitch = ({ const toggleSwitchColorProperty = component.definition.styles.toggleSwitchColor; const toggleSwitchColor = toggleSwitchColorProperty ? toggleSwitchColorProperty.value : '#3c92dc'; const textColor = textColorProperty ? textColorProperty.value : '#000'; - const widgetVisibility = component.definition.styles?.visibility?.value ?? true; - const disabledState = component.definition.styles?.disabledState?.value ?? false; - + const widgetVisibility = component.definition.styles.visibility?.value ?? true; + const disabledState = component.definition.styles.disabledState?.value ?? false; + const parsedDisabledState = typeof disabledState !== 'boolean' ? resolveWidgetFieldValue(disabledState, currentState) : disabledState;