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.
Description
This fixes the send modal currently not closing after successful Tx.
short tl;dr:
This guy isn't defined and makes us throw, meaning the next line will never be evaluated, thus we will never close the modal.
web/src/components/Modals/Send/hooks/useFormSend/useFormSend.tsx
Line 73 in 4dfb467
Long tl;dr:
#4971 brought a refactor of modals, where in addition to perf. improvements, we nest all modal providers inside each other.
This theoretically works, but doesn't if you try and use
useModal()
twice within the same component, with two different modals. The reason for that is actually a missing key in<Provider />
, meaning that each provider isn't properly identified, and callinguseModal()
twice will try and use the context of the previoususeModal('')
, resulting in an empty object context for the current modal, anduseModal('qrCode')
returning undefined, hence us throwing in the line mentioned above.Pull Request Type
Issue (if applicable)
Risk
Testing
Engineering
Operations
Screenshots (if applicable)