bug: slight improvement for home redirection #1742
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
I felt into a random situation multiple time.
After log in, I fall in the home
/
route, and never been redirected to the correct destination (depending on LS or permissions).Ending in only having the side nav displayed, but a blank screen elsewhere.
I can never reproducing afterward, cleaning LS or using private nav did not help.
I was considering that we had some kind of race condition at app boot (I mean, we probably do), where the expected data was not there, even tho the loading of the data was done.
We have an issue with the app boot but landing a big refactor is not something I wanna start right now 😕
Description
To try making it more efficient, I make sure the membership is present and the hook is called if so, before triggering the redirection.
This does not solve the deeper issue but might patch this situation.
Let me know if you see a better approach and if you had the same situation in the past.