diff --git a/app/web/src/components/Customizer/Customizer.tsx b/app/web/src/components/Customizer/Customizer.tsx index 733a444..8ff5654 100644 --- a/app/web/src/components/Customizer/Customizer.tsx +++ b/app/web/src/components/Customizer/Customizer.tsx @@ -14,12 +14,23 @@ import { } from './customizerConverter' const Customizer = () => { - const [open, setOpen] = React.useState(false) const [shouldLiveUpdate, setShouldLiveUpdate] = React.useState(false) const { state, thunkDispatch } = useIdeContext() + const isOpen = state.isCustomizerOpen const customizerParams = state?.customizerParams const currentParameters = state?.currentParameters || {} const handleRender = useRender() + const toggleOpen = () => { + thunkDispatch({ type: 'setCustomizerOpenState', payload: !isOpen }) + if (state.viewerContext === 'ide') { + // don't re-render on open/close in the project profile + setTimeout(() => handleRender()) + } + } + const handleReset = () => { + thunkDispatch({ type: 'resetCustomizer' }) + setTimeout(() => handleRender(true)) + } const updateCustomizerParam = (paramName: string, paramValue: any) => { const payload = { @@ -33,20 +44,20 @@ const Customizer = () => { return (