Fix preset not reloading in some cases

This commit is contained in:
Misode
2021-11-21 04:05:25 +01:00
parent 872a03d44a
commit df06d13ca7
2 changed files with 5 additions and 1 deletions

View File

@@ -42,6 +42,11 @@ export function Generator({ lang, changeTitle, version, changeVersion }: Generat
const searchParams = getSearchParams(getCurrentUrl())
const currentPreset = searchParams.get('preset')
useEffect(() => {
if (model && currentPreset) {
selectPreset(currentPreset)
}
}, [currentPreset])
const [model, setModel] = useState<DataModel | null>(null)
const [blockStates, setBlockStates] = useState<BlockStateRegistry | null>(null)