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.
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: Private personal details are not fetched when navigating by direct link #22906
Fix: Private personal details are not fetched when navigating by direct link #22906
Changes from 17 commits
b6f562c
17ee08a
eed1ecc
0078199
f418f98
d786e80
6dc0046
edc1cfe
755701d
1df7bff
4e0bc85
b3a8c30
f17ca65
5bd9c3a
d452118
ff8ff30
7df5cf8
60ed833
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are we using similar pattern elsewhere? I think it would be better to add
PersonalDetails.openPersonalDetailsPage
call along with theOpenApp
call.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.
hmmm not yet, but I don't think fetching personalDetails along with OpenApp is a good idea. Firstly, we may not access personalDetail page, so fetching personalDetails at first is unnecessary. Secondly, we have many places that use openPage like
PersonalDetails.openPublicProfilePage(accountID)
and it's not executed along withOpenApp
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.
Hm... You do have a valid point. Can you think of a way so that we just have to rely on onyx for getting data inside the component instead of using this hook?
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.
We're still using data from onyx inside the component. we just use the hook to fetch data if needed and don't worry about the performance because we have the logic to prevent fetching data again if it's already in onyx
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.
Thinking about this again, I think this approach is fine actually. We won't have to repeat the usage of
useEffect
on every page where we need this data.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.
@tienifr Can we somehow wrap the following repeating logic into a component of its own?
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.
A component named
PersonalDetailsScreenWrapper
can replaceScreenWrapper
that we're using here.