Skip to content

fix: hex layer now only updates once when changed#1

Open
Rizq0 wants to merge 1 commit intoSnappey:masterfrom
Rizq0:bugfix/layer-issues
Open

fix: hex layer now only updates once when changed#1
Rizq0 wants to merge 1 commit intoSnappey:masterfrom
Rizq0:bugfix/layer-issues

Conversation

@Rizq0
Copy link

@Rizq0 Rizq0 commented Aug 5, 2025

No description provided.

@Rizq0
Copy link
Author

Rizq0 commented Aug 5, 2025

Ignore the prettier formatting, but seemed to have fixed the layer duplication.

I believe there was a form of duplication happening when the hex layer changed. When the shard changed, the event listening was calling initialiseLayers (this.updateHexSectorsLayer(shard);), but the hex sector layers was also managed by hexSectorsEffect. They were both reacting to the same change sometimes causing duplicates to appear.

I removed this.updateHexSectorsLayer(shard); from initaliseLayers and in turn the updateHexSectorsLayer method. Instead, hexSectorsEffect is listening for a shard change and handleHexSectorsVisibility now removes the layer first to then get the updated layer when an event happens.

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.

1 participant