-
Notifications
You must be signed in to change notification settings - Fork 987
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
add ability to add watch-only account #17868
Conversation
Jenkins BuildsClick to see older builds (107)
|
95207b9
to
7dbf0c4
Compare
e57b990
to
3c297bf
Compare
@@ -133,7 +133,7 @@ | |||
| key | description | | |||
| -------------|-------------| | |||
| `:account-name` | A value representing the account name (default `nil`) | |||
| `:account` | A value that represents if the account is a `:watched-account` or a `:default` account. (default `nil`) | |||
| `:account` | A value that represents if the account is a `:watched-address` or a `:default` account. (default `nil`) |
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.
aligns with figma + use in component 👍
e500080
to
a7a7755
Compare
a7a7755
to
1c8bb68
Compare
[react-native.core :as rn] | ||
[status-im2.contexts.wallet.account.tabs.about.style :as style] | ||
[status-im2.contexts.wallet.common.temp :as temp] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn description |
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.
unused as far as I can see. 🤔
:on-press #(rf/dispatch [:show-bottom-sheet {:content about-options}])})] | ||
[quo/account-origin temp/account-origin-state]]) | ||
|
||
(def view (quo.theme/with-theme view-internal)) |
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.
with-theme not actually used 👍
:status :default | ||
:size :default | ||
:title (if watch-only? (i18n/label :t/watched-address) (i18n/label :t/address)) | ||
:custom-subtitle (fn [] [quo/address-text |
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.
adjusted ui for watch only. not keypair data and the label title is correct there.
{:id :about :label (i18n/label :t/about) :accessibility-label :about}]) | ||
(def first-tab-id :assets) | ||
|
||
(defn tabs-data |
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.
filter some tabs out for watch only view. code suggestions welcome :) perhaps a filter on id is cleaner 🤔
:buy-action #(rf/dispatch [:show-bottom-sheet | ||
{:content buy-drawer}]) | ||
:bridge-action #(rf/dispatch [:open-modal :wallet-bridge])}] | ||
(when (not watch-only?) |
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.
hide cta's for watch only accounts
@@ -19,7 +19,7 @@ | |||
number-of-accounts (count (rf/sub [:profile/wallet-accounts])) | |||
account-name (reagent/atom (i18n/label :t/default-account-name | |||
{:number (inc number-of-accounts)})) | |||
address-title (i18n/label :t/watch-address) | |||
address-title (i18n/label :t/watched-address) |
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.
correct label 👍
:on-press #(re-frame/dispatch [:navigate-to | ||
:wallet-account])}} | ||
:on-press #(re-frame/dispatch [:wallet/add-account | ||
nil |
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.
dispatch for add-account, I will make nil
a def of empty-password
:icon :i/correct | ||
:icon-color colors/success-50 | ||
:text (i18n/label :t/account-created {:name name})}]]]}))) | ||
:fx [(when account |
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.
some strange issue where it's not finding the "name" for watched accounts but is for normal accounts 🤷♂️ .
If I log get-in db [:wallet :accounts])
the corresponding account details are there but the look up is not working by address.
Quite strange so I might create a separate issue to investigate it and not block watch only accounts functionality.
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.
Maybe something related to clojure.core/name
🤔
If you need help investigating the issue, let me know 👍
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.
thanks @ulisesmac - given that watch-only accounts are helpful for testing data (e.g we can use accounts with collectibles/assets etc) I will not block this pr but add it as a follow up issue. The address is added find and there's no issues. The name showed once or twice for me, but mostly not. but you could be right with the shadowed var, although I logged the data and it was not showing at all in some cases so I think some form of timing issue, pero no sé
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.
if we have an open issue for this, I can take a look 👍
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.
Ok nice, I will create it!
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.
@ulisesmac found the problem :) The problem was that when you copy an address from Etherscan the letters are uppercase however Status go always returns these as lower case. So then for watch only accounts it could not find the account in the map.
cc @smohamedjavid
I think we should eventually add some handling to the address input page so it goes lower case, but for now I will force the event handling the add account to lowercase 👍
@@ -57,9 +58,9 @@ | |||
[:dispatch [:hide-bottom-sheet]] | |||
[:dispatch-later | |||
[{:dispatch [:navigate-back] | |||
:ms 100} |
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.
trying to fix toast bug, I can revert. either way we need to clean this up with correct transition eventually.
@@ -104,7 +105,7 @@ | |||
|
|||
(rf/defn scan-address-success | |||
{:events [:wallet/scan-address-success]} | |||
[{:keys [db]} address] | |||
[{:keys [db]} [address]] |
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.
will revert 🗡️
:name account-name | ||
:emoji emoji | ||
:path path | ||
:address address | ||
:public-key public-key | ||
:colorID color}] | ||
{:db (update db |
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.
moved to on-success
:new-account? true) | ||
:fx [[:dispatch-later | ||
[{:dispatch [:wallet/get-accounts] | ||
:ms 1500}]]]})) |
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.
must clean
1c8bb68
to
1c184ce
Compare
Thanks @VolodLytvynenko! I thought I had that addressed. Must have been a rebase issue. Will address properly! |
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.
Nice code man 🚀
Actually @VolodLytvynenko - I double checked now and I see that Issue 5 is related to the same issue as the navigation after making a watch only account - basically it is missing the data needed for the UI and also to discriminate and let that page know it is a watch only account and to hide the buttons. This will be fixed in the same follow up issue 👍 |
0b35378
to
1f10d3d
Compare
@VolodLytvynenko - I found the issue that was causing the navigation to watch only accounts to not be right. |
Yes, it shouldn't look like that. The account name should stay on one line and end with ellipsis (...) Here's an example: |
83% of end-end tests have passed
Failed tests (4)Click to expandClass TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityMultipleDeviceMergedTwo:
Expected to fail tests (4)Click to expandClass TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (40)Click to expandClass TestDeepLinksOneDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
Class TestActivityMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMergedTwo:
|
Thanks @Francesca! I'll create an issue to fix that :) |
Hi @J-Son89 thanks for the fixes. I've encountered another issue, but it seems to occur randomly, making it difficult to reproduce with specific steps. It might be logs would be helpful to understand what going on. However, I suggest merging this PR as the issue happens infrequently. Please confirm if this issue will be addressed within the scope of this PR and requires retesting. Otherwise, PR can be merged: ISSUE 6: [Android] 'Cannot read property "ToLoverCase" of null' error is shown during watch only address creationActual result:'Cannot read property "ToLoverCase" of null' error is shown after creation watch only address errorwatchonly.mp4Expected result:The error is not shown Logs:Device:Pixel 7a, Android 13 |
Thanks @VolodLytvynenko - I will merge this pr and create a follow up to handle this and fix the navigation. It should be relatively easy to prevent even if it is rarely happening as I can search for that function and safe guard it 👍 |
… on account page (#17868)
fixes: #17742
This pr connects watch only flow with status go so that watch only addresses can be added.
It also makes a number of UI changes related to watch-only -account
Home Page
Account Page
Testing notes:
To test this page, you can navigate to the new wallet UI. go to the flow of Add a watch only account and then you can actually add an address by going to ether scan. e.g https://etherscan.io/address/0x12E838Ae1f769147b12956485dc56e57138f3AC8
trim.10A1BC4A-9745-4D87-929A-62D57DBA37F3.MOV