Skip to content

Commit f1ce70a

Browse files
committed
change according to the new structure
1 parent c9adffc commit f1ce70a

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/components/shared/Table.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
getTablePages,
99
getTablePagination,
1010
getTableSorting,
11-
getTableStatus,
11+
// getTableStatus,
12+
getTable,
1213
} from "../../selectors/tableSelectors";
1314
import {
1415
Row,
@@ -76,6 +77,7 @@ const Table = ({
7677
editTableViewModalRef.current?.close?.();
7778
};
7879

80+
7981
return (
8082
<>
8183
<Notifications context="above_table" />
@@ -135,12 +137,23 @@ const MultiSelect = ({ selectAllCheckboxRef }: { selectAllCheckboxRef: React.Ref
135137
const dispatch = useAppDispatch();
136138

137139
const multiSelect = useAppSelector(state => getMultiSelect(state));
140+
const table = useAppSelector(state => getTable(state));
141+
142+
const isNewEventAdded = table.flags?.events?.isNewEventAdded;
138143

139144
// Select or deselect all rows on a page
140145
const onChangeAllSelected = (e: React.ChangeEvent<HTMLInputElement>) => {
141146
const selected = e.target.checked;
142147
dispatch(changeAllSelected(selected));
143148
};
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]);
144157

145158
return (
146159
<>
@@ -218,7 +231,7 @@ const TableBody = ({ templateMap }: { templateMap: TemplateMap }) => {
218231

219232
const columnCount = useAppSelector(state => getTableColumns(state).length);
220233
const rowCount = useAppSelector(rowsSelectors.selectTotal);
221-
const status = useAppSelector(state => getTableStatus(state));
234+
// const status = useAppSelector(state => getTableStatus(state));
222235

223236
return (
224237
<>

0 commit comments

Comments
 (0)