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

Wrong address opening when attempt to edit a saved one #22185

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Feb 25, 2025

fixes #22044

Summary

Address editing fixed

Uploading Screen Recording 2025-02-25 at 10.10.18.mov…

Platforms

  • Android
  • iOS

Areas that may be impacted

Functional

  • wallet / transactions

Steps to test

  • Open Status
  • navigate to profile/wallet/saved addresses
  • Add new address
  • Add another address
  • Edit first address
  • Make sure that correct data displayed on editing screen

status: ready

Data to screen was passed via rf-db and acquired in the screen via
sbuscription. But sometimes subscription wasnt calculated yet and
returned nil value. That nil value was captured by use-state and never
updated after subscription updated.
@vkjr vkjr self-assigned this Feb 25, 2025
{:keys [address name customization-color ens ens?]}
(rf/sub [:wallet/saved-address])
(let [{:keys [address name customization-color ens
ens? edit?]} (rf/sub [:get-screen-params])
[address-label set-address-label] (rn/use-state (or name ""))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a root of the problem - we were using data from the subscription and locking it inside the state. So if screen opened before the subscription value updated we ended up with wrong data saved in state hook. Solution is to pass the correct data as screen params instead of subs.

@status-im-auto
Copy link
Member

status-im-auto commented Feb 25, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4db2f93 #1 2025-02-25 10:21:09 ~5 min tests 📄log
✔️ 4db2f93 #1 2025-02-25 10:23:19 ~7 min android 🤖apk 📲
✔️ 4db2f93 #1 2025-02-25 10:24:35 ~9 min android-e2e 🤖apk 📲
✔️ 4db2f93 #1 2025-02-25 10:37:09 ~21 min ios 📱ipa 📲

Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: REVIEW
Development

Successfully merging this pull request may close these issues.

The previously opened Saved Address reopens when attempting to edit a Saved Address
3 participants