Skip to content

Commit e68d602

Browse files
committed
CU-868f1731u More PR 152 cleanup
1 parent b91a662 commit e68d602

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/status/status-bottom-sheet.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,16 @@ export const StatusBottomSheet = () => {
277277
hasPreselectedRef.current = true;
278278
}
279279
}
280-
}, [isOpen, isLoading, selectedStatus, activeCallId, availableCalls, selectedCall, selectedDestinationType, setSelectedCall, setSelectedDestinationType]);
281280

282-
// Additional effect to set the actual call once it becomes available
283-
React.useLayoutEffect(() => {
281+
// Handle case where destination type is already 'call' but call hasn't been set yet
282+
// This covers the scenario from the removed redundant effect
284283
if (isOpen && selectedStatus && (selectedStatus.Detail === 2 || selectedStatus.Detail === 3) && activeCallId && !selectedCall && selectedDestinationType === 'call' && !isLoading && availableCalls.length > 0) {
285284
const activeCall = availableCalls.find((call) => call.CallId === activeCallId);
286285
if (activeCall) {
287286
setSelectedCall(activeCall);
288287
}
289288
}
290-
}, [isOpen, selectedStatus, activeCallId, selectedCall, selectedDestinationType, isLoading, availableCalls, setSelectedCall]);
289+
}, [isOpen, isLoading, selectedStatus, activeCallId, availableCalls, selectedCall, selectedDestinationType, setSelectedCall, setSelectedDestinationType]);
291290

292291
// Smart logic: only show "No Destination" as selected if we truly want no destination
293292
// Don't show it as selected if we're about to pre-select an active call or already have one selected

0 commit comments

Comments
 (0)