mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
Fix preset not reloading in some cases
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user