Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the itemsCoordinates state every time the length of itemsRoute… #1251

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

jorgeart81
Copy link
Contributor

Hello, I hope this PR is helpful to you.

Update the itemsCoordinates state every time the length of itemsRoutes changes.

Before -> the map was returning to its initial state when the state was updated with the socket

bug-2024-06-28.17-25-25.mp4

After

fix-2024-06-28.17-26-10.mp4

@tananaev
Copy link
Member

Why does it update everything on the socket update?

@jorgeart81
Copy link
Contributor Author

jorgeart81 commented Jun 28, 2024

El socket actualiza el estado del store. Por ejemplo en devices en el caso del CombinedReportPage.jsx

It seems to me that PageLayout should be the parent of reports, so it will not be affected.

You can check the PR #1252

@tananaev
Copy link
Member

Sounds like using useMemo would be the right approach here.

@tananaev tananaev merged commit 66b964c into traccar:master Jun 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants