Change how customizer params are applied (#529)

* Only send customizer params when it's open

* Add customizer reset button and have two modes of customizer vs not

depending of if the customizer is open.

* Remove re-render on customizer open/close in project profile
This commit was merged in pull request #529.
This commit is contained in:
Kurt Hutten
2021-09-28 06:05:22 +10:00
committed by GitHub
parent cc50c984e4
commit 38b905e180
5 changed files with 62 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
export const useRender = () => {
const { state, thunkDispatch } = useIdeContext()
return () => {
return (disableParams = false) => {
thunkDispatch((dispatch, getState) => {
const state = getState()
dispatch({ type: 'setLoading' })
@@ -13,7 +13,7 @@ export const useRender = () => {
code: state.code,
viewerSize: state.viewerSize,
camera: state.camera,
parameters: state.currentParameters,
parameters: disableParams ? {} : state.currentParameters,
})
})
localStorage.setItem(makeCodeStoreKey(state.ideType), state.code)