Skip to content

Commit

Permalink
Move map query after dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Markopoulos committed Nov 19, 2024
1 parent f4c5a9f commit becd0e2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ const SiteTable = ({
const isTablet = useMediaQuery(theme.breakpoints.down('sm'));

const handleClick = (event: unknown, site: Row) => {
const mapElement = document.getElementById('sites-map');
dispatch(setSearchResult());
dispatch(setSiteOnMap(sitesList[site.tableData.id]));
const mapElement = document.getElementById('sites-map');
if (scrollPageOnSelection && mapElement) {
mapElement.scrollIntoView({ block: 'center', behavior: 'smooth' });
}
Expand Down

0 comments on commit becd0e2

Please sign in to comment.