mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-22 05:18:08 -05:00
revert
This commit is contained in:
@@ -88,14 +88,11 @@ export function Dropdown({
|
||||
|
||||
const dependsOnFields = useMemo(() => getDependsOnFields(dependsOn), [dependsOn])
|
||||
|
||||
// Stable empty array for when there are no dependencies
|
||||
const emptyDependencyValues = useMemo(() => [], [])
|
||||
|
||||
const activeWorkflowId = useWorkflowRegistry((s) => s.activeWorkflowId)
|
||||
const dependencyValuesFromStore = useSubBlockStore(
|
||||
const dependencyValues = useSubBlockStore(
|
||||
useCallback(
|
||||
(state) => {
|
||||
if (dependsOnFields.length === 0 || !activeWorkflowId) return null
|
||||
if (dependsOnFields.length === 0 || !activeWorkflowId) return []
|
||||
const workflowValues = state.workflowValues[activeWorkflowId] || {}
|
||||
const blockValues = workflowValues[blockId] || {}
|
||||
return dependsOnFields.map((depKey) => blockValues[depKey] ?? null)
|
||||
@@ -104,8 +101,6 @@ export function Dropdown({
|
||||
)
|
||||
)
|
||||
|
||||
const dependencyValues = dependencyValuesFromStore ?? emptyDependencyValues
|
||||
|
||||
const [storeInitialized, setStoreInitialized] = useState(false)
|
||||
const [fetchedOptions, setFetchedOptions] = useState<Array<{ label: string; id: string }>>([])
|
||||
const [isLoadingOptions, setIsLoadingOptions] = useState(false)
|
||||
@@ -115,7 +110,6 @@ export function Dropdown({
|
||||
const previousModeRef = useRef<string | null>(null)
|
||||
const previousDependencyValuesRef = useRef<string>('')
|
||||
|
||||
// State for dataMode conversion (structured ↔ JSON)
|
||||
const [builderData, setBuilderData] = useSubBlockValue<any[]>(blockId, 'builderData')
|
||||
const [data, setData] = useSubBlockValue<string>(blockId, 'data')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user