Skip to content

Fix to not save to savedMap when reuseMaps is false#1555

Merged
Pessimistress merged 3 commits intovisgl:masterfrom
DuGlaser:fix/remove-savedmap-when-no-reusemaps
Sep 6, 2021
Merged

Fix to not save to savedMap when reuseMaps is false#1555
Pessimistress merged 3 commits intovisgl:masterfrom
DuGlaser:fix/remove-savedmap-when-no-reusemaps

Conversation

@DuGlaser
Copy link
Contributor

Hi! Thanks for the great library.
I have been using this library and noticed that when the Map is unmounted, the worker remains even if reuseMaps is false.
In this PR, I changed it so that when the Map is unmounted, if reuseMaps is false, it will not be saved in savedMap.

}

if (!Mapbox.savedMap) {
if (props.reuseMaps && !Mapbox.savedMap) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is going to break an external use case where finalize() is called without arguments. Can you save reuseMaps in setProps instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!
I changed it as shown in 936cbb1.

@DuGlaser DuGlaser requested a review from Pessimistress August 24, 2021 15:24
Copy link
Collaborator

@Pessimistress Pessimistress left a comment

Choose a reason for hiding this comment

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

Thank you!

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