|
8 | 8 | getTablePages, |
9 | 9 | getTablePagination, |
10 | 10 | getTableSorting, |
11 | | - getTableStatus, |
| 11 | + // getTableStatus, |
| 12 | + getTable, |
12 | 13 | } from "../../selectors/tableSelectors"; |
13 | 14 | import { |
14 | 15 | Row, |
@@ -76,6 +77,7 @@ const Table = ({ |
76 | 77 | editTableViewModalRef.current?.close?.(); |
77 | 78 | }; |
78 | 79 |
|
| 80 | + |
79 | 81 | return ( |
80 | 82 | <> |
81 | 83 | <Notifications context="above_table" /> |
@@ -135,12 +137,23 @@ const MultiSelect = ({ selectAllCheckboxRef }: { selectAllCheckboxRef: React.Ref |
135 | 137 | const dispatch = useAppDispatch(); |
136 | 138 |
|
137 | 139 | const multiSelect = useAppSelector(state => getMultiSelect(state)); |
| 140 | + const table = useAppSelector(state => getTable(state)); |
| 141 | + |
| 142 | + const isNewEventAdded = table.flags?.events?.isNewEventAdded; |
138 | 143 |
|
139 | 144 | // Select or deselect all rows on a page |
140 | 145 | const onChangeAllSelected = (e: React.ChangeEvent<HTMLInputElement>) => { |
141 | 146 | const selected = e.target.checked; |
142 | 147 | dispatch(changeAllSelected(selected)); |
143 | 148 | }; |
| 149 | + useEffect(() => { |
| 150 | + if (isNewEventAdded && multiSelect) { |
| 151 | + if (selectAllCheckboxRef.current?.checked) { |
| 152 | + selectAllCheckboxRef.current.checked = false; |
| 153 | + } |
| 154 | + } |
| 155 | + // eslint-disable-next-line react-hooks/exhaustive-deps |
| 156 | + }, [isNewEventAdded, multiSelect]); |
144 | 157 |
|
145 | 158 | return ( |
146 | 159 | <> |
@@ -218,7 +231,7 @@ const TableBody = ({ templateMap }: { templateMap: TemplateMap }) => { |
218 | 231 |
|
219 | 232 | const columnCount = useAppSelector(state => getTableColumns(state).length); |
220 | 233 | const rowCount = useAppSelector(rowsSelectors.selectTotal); |
221 | | - const status = useAppSelector(state => getTableStatus(state)); |
| 234 | + // const status = useAppSelector(state => getTableStatus(state)); |
222 | 235 |
|
223 | 236 | return ( |
224 | 237 | <> |
|
0 commit comments