-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Clear Personal Bank Account Onyx keys in componentWillUnmount #15679
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9252eb1
Fix prop type to avoid console warning
MariaHCD 8403db1
Return early if we already have a selected Plaid accountID
MariaHCD 8644ad6
Revert change to prop type
MariaHCD 347a4f9
Merge remote-tracking branch 'origin/main' into maria-fix-plaid-retri…
MariaHCD eb6027d
Merge remote-tracking branch 'origin/main' into maria-fix-plaid-retri…
MariaHCD c3bdfe7
Revert redundant check
MariaHCD 06a333f
Clear personal bank account Onyx keys before unmount
MariaHCD b38bd78
Merge remote-tracking branch 'origin/main' into maria-fix-plaid-retri…
MariaHCD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 do you know why we're re-entering this view in the first place? I wonder if the fix shouldn't happen outside of the view so this component doesn't get called.
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.
For the issue #15197 we are entering via deep-linking, directly using the URL so it makes sense.
But for another issue, I am confused too.
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.
My theory is that when the user clicks the
Continue
button on the PBA success page, because we clearONYXKEYS.PERSONAL_BANK_ACCOUNT
, shouldShowSuccess evaluates to false and the AddPlaidBankAccount component is mounted again.But I'm not 100% why it only happens during wallet KYC and via deep-linking.
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.
Let me know what you think, @nkuoch @Santhosh-Sellavel
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.
Why do we need to clear details here?
App/src/pages/AddPersonalBankAccountPage.js
Lines 101 to 103 in 347a4f9
Does it affect anything else, if it needs to be cleared we can do it at
componentWillUnmount
@MariaHCD or @nkuoch
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.
Good idea. I think we can remove
BankAccounts.clearPersonalBankAccount();
from onButtonPress. The original idea was to make sure it's cleared for any next setup, but we already call it in componentDidMount, so it's probably useless here.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.
Oh, nice catch, @Santhosh-Sellavel! I think it would make sense to call it in
componentWillUnmount
. We're also calling it at componentDidMount but maybe it makes more sense to just have it incomponentWillUnmount
just so that there isn't any outdated data in the Onyx keys once the PBA is added. Thoughts?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.
I agree let me know when changes are done!