Corner radius slider no longer slides (#2784)

* Corner radius slider no longer slides

* revert

* add optional chaining
This commit is contained in:
Dhanu Saputra 2023-03-09 06:00:10 +07:00 committed by GitHub
parent 769b2a4ddc
commit 7e7d655615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
)}
/>
</Col>
@ -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)',
}}
/>