mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 15:17:09 +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)
|
||||
|
||||
@@ -417,7 +417,6 @@ function StringSuffix({ path, getValues, config, node, value, lang, version, sta
|
||||
} else {
|
||||
const datalistId = hexId()
|
||||
const gen = id ? findGenerator(id) : undefined
|
||||
console.log(id, gen)
|
||||
return <>
|
||||
<input value={value ?? ''} onBlur={onChange} onKeyDown={evt => {if (evt.key === 'Enter') onChange(evt)}}
|
||||
list={values.length > 0 ? datalistId : ''} />
|
||||
|
||||
Reference in New Issue
Block a user