Skip to content

Commit 58b2c98

Browse files
committed
last sec stuff
1 parent 3346234 commit 58b2c98

File tree

2 files changed

+14
-6
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components

2 files changed

+14
-6
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,12 @@ export function ComboBox({
287287
// Skip if already hydrated with the same value
288288
if (hydratedOption?.id === valueToHydrate) return
289289

290-
// Skip if value is already in fetched options
291-
const alreadyInOptions = fetchedOptions.some((opt) => opt.id === valueToHydrate)
292-
if (alreadyInOptions) return
290+
// Skip if value is already in fetched options or static options
291+
const alreadyInFetchedOptions = fetchedOptions.some((opt) => opt.id === valueToHydrate)
292+
const alreadyInStaticOptions = staticOptions.some((opt) =>
293+
typeof opt === 'string' ? opt === valueToHydrate : opt.id === valueToHydrate
294+
)
295+
if (alreadyInFetchedOptions || alreadyInStaticOptions) return
293296

294297
// Track if effect is still active (cleanup on unmount or value change)
295298
let isActive = true
@@ -314,6 +317,7 @@ export function ComboBox({
314317
isPreview,
315318
disabled,
316319
fetchedOptions,
320+
staticOptions,
317321
hydratedOption?.id,
318322
])
319323

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,12 @@ export function Dropdown({
383383
// Skip if already hydrated with the same value
384384
if (hydratedOption?.id === valueToHydrate) return
385385

386-
// Skip if value is already in fetched options
387-
const alreadyInOptions = fetchedOptions.some((opt) => opt.id === valueToHydrate)
388-
if (alreadyInOptions) return
386+
// Skip if value is already in fetched options or static options
387+
const alreadyInFetchedOptions = fetchedOptions.some((opt) => opt.id === valueToHydrate)
388+
const alreadyInStaticOptions = evaluatedOptions.some((opt) =>
389+
typeof opt === 'string' ? opt === valueToHydrate : opt.id === valueToHydrate
390+
)
391+
if (alreadyInFetchedOptions || alreadyInStaticOptions) return
389392

390393
// Track if effect is still active (cleanup on unmount or value change)
391394
let isActive = true
@@ -411,6 +414,7 @@ export function Dropdown({
411414
isPreview,
412415
disabled,
413416
fetchedOptions,
417+
evaluatedOptions,
414418
hydratedOption?.id,
415419
])
416420

0 commit comments

Comments
 (0)