Skip to content

Commit

Permalink
Remove outdated pin screens
Browse files Browse the repository at this point in the history
Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
  • Loading branch information
Ferossgp committed Mar 10, 2020
1 parent 1cc9451 commit 5334b82
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 38 deletions.
8 changes: 6 additions & 2 deletions src/status_im/hardwallet/common.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,12 @@
(let [key-uid (get-in db [:hardwallet :application-info :key-uid])
multiaccount-key-uid (get-in db [:multiaccount :key-uid])
keycard-multiaccount? (boolean (get-in db [:multiaccount :keycard-pairing]))]
;; TODO(Ferossgp): If last oepration was with wrong card
;; it does not mean that current operation will be with the same card
;; TODO(Ferossgp): If last oeperation was with wrong card,
;; it does not mean that current operation will be with the same card.
;; Because key-uid is stored from latest application-info read user can't
;; start the new operation cause account key-uid is not equal to the one from old read
;; Ideally application info should not be stored in db and only checked when need
;; thus we can ensure that we have always the right card info and not outdated one.
(if (or (nil? keycard-multiaccount?)
(and key-uid
(= key-uid multiaccount-key-uid)))
Expand Down
21 changes: 0 additions & 21 deletions src/status_im/hardwallet/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@
[status-im.multiaccounts.update.core :as multiaccounts.update]
[status-im.multiaccounts.recover.core :as multiaccounts.recover]))

(fx/defn enter-pin-navigate-back-button-clicked
{:events [:hardwallet.ui/enter-pin-navigate-back-button-clicked]}
[{:keys [db] :as cofx}]
(let [screen-before (set (take 4 (:navigation-stack db)))
navigate-to-browser? (contains? screen-before :browser-stack)]
(if navigate-to-browser?
(fx/merge cofx
(common/clear-on-card-connected)
;;TODO use new signing flow
;;(wallet/discard-transaction)
(navigation/navigate-to-cofx :browser nil))
(if (= :enter-pin-login (:view-id db))
(navigation/navigate-to-cofx cofx :multiaccounts nil)
(fx/merge cofx
(common/clear-on-card-connected)
(navigation/navigate-back))))))

(fx/defn show-keycard-has-multiaccount-alert
[{:keys [db] :as cofx}]
(fx/merge cofx
Expand Down Expand Up @@ -108,10 +91,6 @@
(assoc-in [:hardwallet :setup-step] nil))}
(common/clear-on-card-connected)))

(defn hardwallet-connect-screen-did-load
[{:keys [db]}]
{:db (assoc-in db [:hardwallet :card-read-in-progress?] false)})

(defn reset-card-screen-did-load
[{:keys [db]}]
{:db (assoc-in db [:hardwallet :reset-card :disabled?] false)})
Expand Down
4 changes: 1 addition & 3 deletions src/status_im/ui/components/tabbar/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@
(minimize-bar new-view-id))))
:reagent-render
(fn [keyboard-shown? view-id tab]
(when-not (contains? #{:enter-pin-login
:enter-pin-sign
:enter-pin-settings} view-id)
(when-not (contains? #{:enter-pin-settings} view-id)
(case platform/os
"ios" [tabs-animation-wrapper-ios
[react/animated-view
Expand Down
3 changes: 0 additions & 3 deletions src/status_im/ui/screens/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@
:home (chat.loading/offload-all-messages cofx)
:keycard-settings (hardwallet/settings-screen-did-load %)
:reset-card (hardwallet/reset-card-screen-did-load %)
:enter-pin-login (hardwallet/enter-pin-screen-did-load %)
:enter-pin-sign (hardwallet/enter-pin-screen-did-load %)
:enter-pin-settings (hardwallet/enter-pin-screen-did-load %)
:enter-pin-modal (hardwallet/enter-pin-screen-did-load %)
:keycard-login-pin (hardwallet/enter-pin-screen-did-load %)
:add-new-account-pin (hardwallet/enter-pin-screen-did-load %)
:hardwallet-authentication-method (hardwallet/authentication-method-screen-did-load %)
Expand Down
6 changes: 1 addition & 5 deletions src/status_im/ui/screens/hardwallet/pin/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@
error-label [:hardwallet/pin-error-label]]
[react/view {:flex 1
:background-color colors/white}
[topbar/topbar
{:navigation
{:icon :main-icons/back
:accessibility-label :back-button
:handler #(re-frame/dispatch [:hardwallet.ui/enter-pin-navigate-back-button-clicked])}}]
[topbar/topbar {}]
(if (zero? pin-retry-counter)
[pin-view {:pin pin
:retry-counter (when (< puk-retry-counter puk-retries) puk-retry-counter)
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/ui/screens/routing/intro_login_stack.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
:config (if
;; add view-id here if you'd like that view to be
;; first view when app is started
(#{:login :progress :multiaccounts :enter-pin-login :keycard-login-pin} view-id)
(#{:login :progress :multiaccounts :keycard-login-pin} view-id)
{:initialRouteName view-id}
{:initialRouteName :login})})

Expand Down
1 change: 0 additions & 1 deletion src/status_im/ui/screens/routing/modals.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[:chat-modal
:stickers-pack-modal
:tribute-learn-more
:enter-pin-modal
:selection-modal-screen
:wallet-transactions-filter
:welcome
Expand Down
2 changes: 0 additions & 2 deletions src/status_im/ui/screens/routing/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
:intro intro/intro
:hardwallet-authentication-method hardwallet.authentication/hardwallet-authentication-method
:enter-pin-settings hardwallet.pin/enter-pin
:enter-pin-sign hardwallet.pin/enter-pin
:enter-pin-modal [:modal hardwallet.pin/enter-pin]
:keycard-onboarding-intro keycard.onboarding/intro
:keycard-onboarding-puk-code keycard.onboarding/puk-code
:keycard-onboarding-pin keycard.onboarding/pin
Expand Down

0 comments on commit 5334b82

Please sign in to comment.