-
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
[#21318] Keycard - Allow user to initiate Profile key pair migration … #21359
[#21318] Keycard - Allow user to initiate Profile key pair migration … #21359
Conversation
Jenkins BuildsClick to see older builds (4)
|
55e5b44
to
d757f02
Compare
…on an empty Keycard
d757f02
to
2e25235
Compare
@@ -0,0 +1,42 @@ | |||
(ns status-im.contexts.keycard.error.view |
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.
do not review this screen, is a temporary implementation will be finished in the next PRs
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.
Looking good! Thanks for the PR 🙌
Left a few comments and questions, let me know what you think 🙏
event-vector [:keycard/get-application-info | ||
{:on-success #(rf/dispatch [:keycard/on-get-application-info-success % args])}]] |
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.
I think we might need to be careful with storing functions in the database. Maybe it's not a problem in this case, but if we try to serialise the db-state then we may not be able to deserialise the function later.
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.
i wouldn't think about this much, i mean serializing db ) we should do it how it's better for now, but I agree, I'm also not a fun of such an approach, we could think how we could improve it later
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.
later on if we update the keycard effects to use call-continuation
, then we may be able to do something like this:
[:keycard/get-application-info
{:on-success [:keycard/on-get-application-info-success args]}]
But we would need to refactor :keycard/on-get-application-info-success
to the it's arguments in a different order (I think).
thank you for the review @seanstrom |
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.
Hi @flexsurfer !
Thanks for this PR! I left a couple of comments but it looks great at code level in general.
I'd like to ask for a PR description summarizing the changes made and, if possible, a demo video or some screenshots of the implementation running, some steps to test would be also be helpful for reviewers.
I know we aren't asking for QA now, is it because the feature isn't complete yet? If it's testable I'd suggest to ask for QA so that we don't accumulate possible bugs and the future feature flag removal is easier for everyone.
[] | ||
[:<> | ||
[quo/page-nav | ||
{:key :header |
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.
Just wondering if we really need to provide key
:flex 1 | ||
:align-items :flex-start})) | ||
|
||
(def index | ||
{:margin-left 5}) | ||
|
||
(def text-container | ||
{:margin-left 8 | ||
:flex 1}) | ||
{:margin-left 8}) |
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.
Since we modified the markdown-list
component, are we checking the UI isn't broken in other screens where it is used?
@@ -10,10 +10,15 @@ | |||
|
|||
(defonce ^:private active-listeners (atom [])) |
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.
Just wondering why do we use a global atom to track the state. I know this was already here, but I think this could live in re-frame 🤔
:on-press #(rf/dispatch [:show-bottom-sheet | ||
{:theme :dark | ||
:content (fn [] [sheets.migrate/view])}])}]] |
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.
I think the. value for :content
is already a function, so we don't need to wrap it into another one, i.e. we can directly pass sheets.migrate/view
(rf/reg-event-fx :keycard/on-action-with-pin-error | ||
(fn [{:keys [db]} [error]] | ||
(log/debug "[keycard] get keys error: " error) | ||
(log/debug "[keycard] on-action-with-pin-error: " error) |
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.
AFAIK we have an event to log errors, so we can use it
"Ready to Scan"] | ||
(i18n/label :t/ready-to-scan)] | ||
[rn/image | ||
{:source (resources/get-image :nfc-prompt)}] | ||
[rn/text {:style {:font-size 16 :color :white :margin-vertical 36}} | ||
(if connected? | ||
"Connected. Don’t move your card." | ||
"Hold your phone near a Status Keycard")] | ||
(i18n/label :t/connected-dont-move) | ||
(i18n/label :t/hold-phone-near-keycard))] |
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.
👍
[quo/text {} | ||
(i18n/label :t/migrate-key-pair-keycard-default-key {:name profile-name})] |
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.
I think we can avoid this empty map
:on-success | ||
#(do | ||
(rf/dispatch [:keycard/disconnect]) | ||
(rf/dispatch |
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.
Since we are modifying this code, we could change #(do ...)
-> (fn [] ...)
thanks @ulisesmac, all the information is in the task itself, there is no need to duplicate it in the PR, it's not worth it to waste time on each PR, it is better to test the final result with full functionality |
fixes: #21318