Skip to content

Conversation

@ayolab
Copy link
Contributor

@ayolab ayolab commented Oct 13, 2025

No description provided.

Signed-off-by: Ayoub LABIDI <[email protected]>
Comment on lines 1032 to 1039
return {
zoom: networkMapRef.current?.getCurrentViewState()?.zoom,
center: [
networkMapRef.current?.getCurrentViewState()?.center.lng,
networkMapRef.current?.getCurrentViewState()?.center.lat,
] as [number, number],
filteredNominalVoltages: filteredNominalVoltages,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call getCurrentViewState() only once

Plus, casting "as [number, number]" here is hiding the problem where "networkMapRef.current?.getCurrentViewState()" is nullish, handle it properly ?
Maybe reset to default positions if no ref is found (should not happen though)

Copy link
Contributor

@EstherDarkish EstherDarkish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test OK, console warning OK

Signed-off-by: Ayoub LABIDI <[email protected]>
@ayolab ayolab force-pushed the ayolab/add-map-state-persistance branch from 4985fbe to e154693 Compare October 17, 2025 11:41
@ayolab ayolab force-pushed the ayolab/add-map-state-persistance branch from ba3a33e to dac0c41 Compare October 17, 2025 12:23
@sonarqubecloud
Copy link

@EstherDarkish EstherDarkish self-requested a review October 17, 2025 13:09
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.

5 participants