Skip to content

Commit

Permalink
DBC22-1806: hook and key fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed Feb 27, 2024
1 parent f5adca8 commit 9aeb7ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/Components/events/EventsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ export default function EventsTable(props) {
const rows = [];
for (let i = 0; i < 20; i++) {
rows.push(
<tr>
{table.getAllColumns().map((column) => {
<tr key={`loader-row-${i}`}>
{table.getAllColumns().map((column, j) => {
return (
<td className={`${column.id} loading`} key={`loader-{i}`}>
<td className={`${column.id} loading`} key={`loader-column-${i}-${j}`}>
<Skeleton />
</td>
);
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/src/pages/EventsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default function EventsListPage() {
};

useEffect(() => {
loadEvents(selectedRoute);
setShowLoader(true);

if (selectedRoute && selectedRoute.routeFound) {
setRouteEdit(false);
Expand All @@ -153,15 +153,15 @@ export default function EventsListPage() {

useEffect(() => {
if (events) {
setShowLoader(true);
processEvents();
setTimeout(() => setShowLoader(false), 5000);
// setShowLoader(false);
}
}, [events, eventCategoryFilter]);

useEffect(() => {
if (showLoader) {
processEvents();
setTimeout(() => setShowLoader(false), 5000);
// setShowLoader(false);
loadEvents(selectedRoute);
}
}, [showLoader]);

Expand Down

0 comments on commit 9aeb7ef

Please sign in to comment.