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

Wallet: notification for sending collectibles to unpreferred network #20746

Closed
wants to merge 6 commits into from

Conversation

OmarBasem
Copy link
Contributor

fixes: #20257

Summary

This PR implements showing notification alert when sending a collectible to an unpreferred network by the receiver.

Demo

Screen_Recording_20240715_113011_Status.mp4

@status-im-auto
Copy link
Member

status-im-auto commented Jul 15, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9befbf5 #1 2024-07-15 07:37:23 ~4 min tests 📄log
✔️ 9befbf5 #1 2024-07-15 07:39:05 ~6 min android-e2e 🤖apk 📲
✔️ 9befbf5 #1 2024-07-15 07:40:31 ~8 min android 🤖apk 📲
✔️ 9befbf5 #1 2024-07-15 07:42:26 ~10 min ios 📱ipa 📲
1963d47 #2 2024-07-16 04:54:43 ~2 min ios 📄log
✔️ 1963d47 #2 2024-07-16 04:55:55 ~3 min tests 📄log
✔️ 1963d47 #2 2024-07-16 04:58:20 ~6 min android 🤖apk 📲
✔️ 1963d47 #2 2024-07-16 04:58:45 ~6 min android-e2e 🤖apk 📲

@OmarBasem OmarBasem requested a review from a team July 15, 2024 12:10
@OmarBasem OmarBasem changed the title Walle: notification for sending collectibles to unpreferred network Wallet: notification for sending collectibles to unpreferred network Jul 15, 2024
Copy link
Contributor

@ulisesmac ulisesmac left a comment

Choose a reason for hiding this comment

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

Hi Omar!

Thanks for your PR! I left some comments

Comment on lines 328 to 329
:testnet-enabled? (rf/sub [:profile/test-networks-enabled?])
:goerli-enabled? (rf/sub [:profile/is-goerli-enabled?])})
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't we getting a warning about subscribing outside of a reactive context with these?

Comment on lines 332 to 333
(rf/sub [:wallet/wallet-send-tx-type])))
send-transaction-data (rf/sub [:wallet/wallet-send])
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not common to subscribe in event callbacks 🤔 I think we should avoid it. Please check https://day8.github.io/re-frame/FAQs/UseASubscriptionInAnEventHandler/#the-root-problem

Copy link
Contributor Author

@OmarBasem OmarBasem Jul 16, 2024

Choose a reason for hiding this comment

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

Thanks @ulisesmac! Refactored the function to an event

:contract-id
:chain-id)
collectible-to-unpreferred? (when collectible-tx?
(not (some #(= collectible-network %) receiver-networks)))
Copy link
Contributor

Choose a reason for hiding this comment

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

not-any?

Comment on lines 159 to 163
recipient {:label
(utils/get-shortened-address
splitted-address)
:recipient-type :address}]
Copy link
Contributor

Choose a reason for hiding this comment

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

The code style here looks very uncommon. consider extracting a call to another binding so that this map is formatted consistently:

Either:

{:a 'a
 :b 'b}

or (ugly):

{:a
 'a
 :b
 'b}

But mixing these is not great

@OmarBasem OmarBasem force-pushed the wallet/collectible-unpreferred branch from 9befbf5 to 1963d47 Compare July 16, 2024 04:51
@OmarBasem OmarBasem requested review from ulisesmac and a team July 16, 2024 04:54
@J-Son89
Copy link
Member

J-Son89 commented Jul 16, 2024

Unfortunately I think we should hold this pr given that by 2.31 we will look to remove this complex router feature. It is likely we will remove it again in a few weeks.

Given that information do we think it is worth adding now?
cc @smohamedjavid, @ulisesmac, @briansztamfater wdyt? 🤔

@ulisesmac
Copy link
Contributor

Unfortunately I think we should hold this pr given that by 2.31 we will look to remove this complex router feature. It is likely we will remove it again in a few weeks.

Given that information do we think it is worth adding now?
cc @smohamedjavid, @ulisesmac, @briansztamfater wdyt? 🤔

Then IMO we shouldn't merge this PR, not merging means less work to do, otherwise, we will need to open an issue to remove the code added in this PR.

@J-Son89
Copy link
Member

J-Son89 commented Jul 25, 2024

@OmarBasem - can we close this pr for now? 🙏

@OmarBasem OmarBasem closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

Notification for sending collectibles to unpreferred network
4 participants