-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Optional gameId/seasonId in routes and redirection #874
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right idea, but this prevents initial navigation to the stats page (before season ids are downloaded).
This issue was just closed, coincidentally, so I'll close this PR. Sorry for the miscommunication!
Upon a second look, I think this is appropriate for the /game, /lobby and /spectate routes, just not for /stats, because stats downloads the season ids on created(). In that case I think it makes sense to update the helper function to specifically look for the gameId param (and to rename it accordingly) |
@itsalaidbacklife yep, ok. I'll do the changes. 👍 |
So, after looking at the your code and noticing you added the @Posoroko @itsalaidbacklife what are your thoughts? |
About the possible confusion... If I have this right, this redirection would only occur if the user manually enter a url with no param. Wich is not really the expected behaviour. So weird results when trying to "hack" the router is probably not so problematic. Could we redirect home and get the router to throw an error to be displayed if the gameId is missing ? something like : "Please provide a game id or select a game in the list" |
So by just adding the optional param to I feel like if someone puts the link in they won't know what went wrong if they're just automatically redirected |
@Posoroko sorry it's taken me so long to get back to a review here! I've been hellbent on wrapping up some changes and then coordinating the logistics of the Cuttle World Championship last Saturday and now that we're through that, I have bandwidth to dig back into QoL improvements like this. I agree with @Haviles04 that it would be ideal to show the |
@itsalaidbacklife @Posoroko I think the ? On the gameID is enough actually.. it'll load gameView but the store won't have an id which will trigger the dialog |
@@ -104,7 +104,7 @@ const routes = [ | |||
}, | |||
}, | |||
{ | |||
path: '/stats/:seasonId?', | |||
path: '/stats/:seasonId', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have the ?
this way you can see the stats page with or without a seasonId
Issue number
Relevant issue number
Please check the following
Please describe additional details for testing this change
-made the gameId and seasonId optional in the routes that should contain it. (lobby, game, spectate and rematch, stats)
-redirection to home if no gameId/seasonId is found in the route path