Skip to content

Commit c0cd00a

Browse files
committed
fix: avoid forced async selector refetch on open
1 parent 76f36ea commit c0cd00a

File tree

2 files changed

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

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ export const ComboBox = memo(function ComboBox({
473473
const handleOpenChange = useCallback(
474474
(open: boolean) => {
475475
if (open) {
476-
void fetchOptionsIfNeeded(true)
476+
void fetchOptionsIfNeeded(Boolean(fetchError))
477477
}
478478
},
479-
[fetchOptionsIfNeeded]
479+
[fetchOptionsIfNeeded, fetchError]
480480
)
481481

482482
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ export const Dropdown = memo(function Dropdown({
214214
const handleOpenChange = useCallback(
215215
(open: boolean) => {
216216
if (open) {
217-
void fetchOptionsIfNeeded(true)
217+
void fetchOptionsIfNeeded(Boolean(fetchError))
218218
}
219219
},
220-
[fetchOptionsIfNeeded]
220+
[fetchOptionsIfNeeded, fetchError]
221221
)
222222

223223
const evaluatedOptions = useMemo(() => {

0 commit comments

Comments
 (0)