mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
fix: clamp connection rowIndex to list size
This commit is contained in:
@@ -680,6 +680,9 @@ const ChangeConnectionBlockModal = React.memo(
|
||||
},
|
||||
[changeConnModalAtom, viewModel, blockId, connSelected, selectionList]
|
||||
);
|
||||
React.useEffect(() => {
|
||||
setRowIndex((idx) => Math.min(idx, filteredList.length));
|
||||
}, [selectionList, setRowIndex]);
|
||||
// this check was also moved to BlockFrame to prevent all the above code from running unnecessarily
|
||||
if (!changeConnModalOpen) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user