Skip to content
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: avoid crash when changing tab in send asset popup #7453

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

VmMad
Copy link
Member

@VmMad VmMad commented Sep 25, 2023

Summary

Fixes #7340

Fix bug in send asset popup to avoid crashes in releases.
...

Changelog

- Fix types in `getNftByIdFromAllAccountNfts` and `NftInput` component
- Only set "selected nft" if the nft exists

Testing

Platforms

Please select any platforms where your changes have been tested.

  • Desktop
    • MacOS
    • Linux
    • Windows

Instructions

  • Click send asset
  • Switch to "Send nft"
  • In NFT Id, insert a random string (or your own address for example)
  • Switch to "Send token" tab
  • Switch to "Send nft" tab again. No crash should happen now.

...

Checklist

Please tick the following boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or modified tests that prove my changes work as intended
  • I have verified that new and existing unit tests pass locally with my changes
  • I have verified that my latest changes pass CI workflows for testing and linting
  • I have made corresponding changes to the documentation

Copy link
Collaborator

@marc2332 marc2332 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works ⚡

Copy link
Member

@begonaalvarezd begonaalvarezd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work properly, if you switch tabs and there was a selected NFT, it should select it again when you get back to the tab, and now it doesnt.
There is a reactivity issue in this implementation and its because before selected was initialized directly calling getNftByIdFromAllAccountNfts which always retuned an NFT if the id was right, but now selected depends on selectedNftById which gets filled reactively, so very likely if nftId had a value when the component mounts, selected will not see it

@VmMad VmMad requested a review from begonaalvarezd October 11, 2023 14:59
@begonaalvarezd begonaalvarezd merged commit b372880 into develop Oct 17, 2023
4 checks passed
@begonaalvarezd begonaalvarezd deleted the fix/avoid-nft-send-crash branch October 17, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report]: Firefly no response from btn after wrong string entry in nft tab
3 participants