mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-13 16:05:09 -05:00
fix(tool-input): sync cleared subblock values to tool params (#3214)
This commit is contained in:
@@ -78,8 +78,13 @@ export function ToolSubBlockRenderer({
|
||||
}, [toolParamValue, setStoreValue, isObjectType])
|
||||
|
||||
useEffect(() => {
|
||||
if (storeValue == null) return
|
||||
const stringValue = typeof storeValue === 'string' ? storeValue : JSON.stringify(storeValue)
|
||||
if (storeValue == null && lastPushedToParamsRef.current === null) return
|
||||
const stringValue =
|
||||
storeValue == null
|
||||
? ''
|
||||
: typeof storeValue === 'string'
|
||||
? storeValue
|
||||
: JSON.stringify(storeValue)
|
||||
if (stringValue !== lastPushedToParamsRef.current) {
|
||||
lastPushedToParamsRef.current = stringValue
|
||||
lastPushedToStoreRef.current = stringValue
|
||||
|
||||
Reference in New Issue
Block a user