From 7e7d6556153ae7dd6948bed7e02dc86487cc10e0 Mon Sep 17 00:00:00 2001 From: Dhanu Saputra <35093673+dhanusaputra@users.noreply.github.com> Date: Thu, 9 Mar 2023 06:00:10 +0700 Subject: [PATCH] Corner radius slider no longer slides (#2784) * Corner radius slider no longer slides * revert * add optional chaining --- .../admin/config/general/AppearanceConfig.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/components/admin/config/general/AppearanceConfig.tsx b/web/components/admin/config/general/AppearanceConfig.tsx index baa25f2c2..4b16d2c3d 100644 --- a/web/components/admin/config/general/AppearanceConfig.tsx +++ b/web/components/admin/config/general/AppearanceConfig.tsx @@ -181,7 +181,7 @@ export default function Appearance() { onSuccess: () => { setSubmitStatus(createInputStatus(STATUS_SUCCESS, 'Updated.')); resetTimer = setTimeout(resetStates, RESET_TIMEOUT); - setCustomValues(null); + setCustomValues({}); }, onError: (message: string) => { setSubmitStatus(createInputStatus(STATUS_ERROR, message)); @@ -265,7 +265,9 @@ export default function Appearance() { onBorderRadiusChange(v); }} value={Number( - defaultValues['theme-rounded-corners']?.value?.replace('px', '') || 0, + customValues?.['theme-rounded-corners']?.value?.replace('px', '') ?? + defaultValues?.['theme-rounded-corners']?.value?.replace('px', '') ?? + 0, )} /> @@ -274,7 +276,10 @@ export default function Appearance() { style={{ width: '100px', height: '30px', - borderRadius: `${defaultValues['theme-rounded-corners']?.value}`, + borderRadius: `${ + customValues?.['theme-rounded-corners']?.value ?? + defaultValues?.['theme-rounded-corners']?.value + }`, backgroundColor: 'var(--theme-color-palette-7)', }} />