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

Fix bug in handling of navigation events #1825

Merged
merged 2 commits into from
Jul 14, 2020

Conversation

BlackYps
Copy link
Collaborator

Fixes #1807
Posting a navigation event when initializing a tab had side effects when a navigate event (e.g. clicking on the show ladder maps button) took you to a previously uninitialized tab, because that would also trigger the event in initialize().
If we want that, the new behaviour could be improved even further by writing the lastTab information to the preferences, so the client can remember which tabs you had open even over a restart.

1-alex98
1-alex98 previously approved these changes Jul 13, 2020
if (navigateEvent instanceof OpenGlobalLeaderboardEvent) {
leaderboardRoot.getSelectionModel().select(globalLeaderboardTab);
globalLeaderboardController.display(navigateEvent);
else if (navigateEvent instanceof OpenGlobalLeaderboardEvent) {
Copy link
Member

Choose a reason for hiding this comment

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

same line as }

Copy link
Member

@1-alex98 1-alex98 left a comment

Choose a reason for hiding this comment

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

Since we had a bug there. How about u try to write a unit test that makes sure this never happens again.
Test if after a X Event the x tab is opened.

@BlackYps
Copy link
Collaborator Author

Testing if the correct tab is opened is not enough. We would need to test that it actually shows the ladder maps and not the front page of the map vault. you can actually see that it did that for a brief moment and then the second navigate event resetted the view to the start view. I don't know how to test for this properly. We could try to test if mapService.getLadderMaps() got called, but that would have passed even with this bug...

@1-alex98 1-alex98 merged commit cd67aec into develop Jul 14, 2020
@Brutus5000 Brutus5000 deleted the bugfix/#1807-navigate-event-handling branch November 4, 2020 21:40
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.

Clicking view replays doesn't show the replays of a player without having the maps loaded
2 participants