From 461e67a46b7d112ac15aceaadca736504010029c Mon Sep 17 00:00:00 2001 From: yenda Date: Fri, 8 May 2020 14:01:55 +0200 Subject: [PATCH] fix incoming/outgoing bug Signed-off-by: yenda --- src/status_im/multiaccounts/login/core.cljs | 9 ++++++--- src/status_im/ui/screens/chat/message/command.cljs | 9 ++++----- src/status_im/ui/screens/chat/message/message.cljs | 4 ++-- src/status_im/ui/screens/dapps_permissions/views.cljs | 9 ++++++--- src/status_im/ui/screens/desktop/main/views.cljs | 7 ++----- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 5c2c5b30b2..7da78acb50 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -369,13 +369,16 @@ "keycard-multiacc?" keycard-multiaccount?) (fx/merge cofx {:db (assoc db :auth-method auth-method)} - #(case auth-method - keychain/auth-method-biometric + #(cond + (= auth-method + keychain/auth-method-biometric) (biometric/biometric-auth %) - keychain/auth-method-password + (= auth-method + keychain/auth-method-password) (get-credentials % key-uid) ;;nil or "none" or "biometric-prepare" + :else (open-login-callback % nil))))) (fx/defn biometric-auth-done diff --git a/src/status_im/ui/screens/chat/message/command.cljs b/src/status_im/ui/screens/chat/message/command.cljs index 702222f445..78b0a115ff 100644 --- a/src/status_im/ui/screens/chat/message/command.cljs +++ b/src/status_im/ui/screens/chat/message/command.cljs @@ -181,14 +181,13 @@ (str amount-fiat " " code)]]])) (defn calculate-direction [outgoing command-state] - (case command-state - (constants/command-state-request-address-for-transaction-accepted - constants/command-state-request-address-for-transaction-declined - constants/command-state-request-transaction) + (if (#{constants/command-state-request-address-for-transaction-accepted + constants/command-state-request-address-for-transaction-declined + constants/command-state-request-transaction} command-state) (if outgoing :incoming :outgoing) (if outgoing :outgoing :incoming))) -(defn comand-content +(defn command-content [wrapper {:keys [message-id chat-id outgoing diff --git a/src/status_im/ui/screens/chat/message/message.cljs b/src/status_im/ui/screens/chat/message/message.cljs index e1e48d0b5b..4c118abb33 100644 --- a/src/status_im/ui/screens/chat/message/message.cljs +++ b/src/status_im/ui/screens/chat/message/message.cljs @@ -269,14 +269,14 @@ (defn chat-message [{:keys [content content-type] :as message}] (if (= content-type constants/content-type-command) - [message.command/comand-content message-content-wrapper message] + [message.command/command-content message-content-wrapper message] (if (= content-type constants/content-type-system-text) [system-message-content-wrapper message [system-text-message message]] [react/touchable-highlight (message-press-handlers message) [message-content-wrapper message (if (= content-type constants/content-type-text) - ; text message + ;; text message [text-message message] (if (= content-type constants/content-type-status) [message-content-status message] diff --git a/src/status_im/ui/screens/dapps_permissions/views.cljs b/src/status_im/ui/screens/dapps_permissions/views.cljs index 2249fa5111..2ca6dffe6d 100644 --- a/src/status_im/ui/screens/dapps_permissions/views.cljs +++ b/src/status_im/ui/screens/dapps_permissions/views.cljs @@ -2,6 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] [status-im.i18n :as i18n] + [status-im.constants :as constants] [status-im.ui.components.react :as react] [status-im.ui.components.list.views :as list] [status-im.ui.components.colors :as colors] @@ -22,9 +23,11 @@ (defn prepare-items-manage [name] (fn [permission] - {:title (case permission - constants/dapp-permission-web3 name - constants/dapp-permission-contact-code :t/contact-code) + {:title (cond + (= permission constants/dapp-permission-web3) + name + (= permission constants/dapp-permission-contact-code) + :t/contact-code) :type :small :accessories [:main-icons/check]})) diff --git a/src/status_im/ui/screens/desktop/main/views.cljs b/src/status_im/ui/screens/desktop/main/views.cljs index d755b7f606..ec94214416 100644 --- a/src/status_im/ui/screens/desktop/main/views.cljs +++ b/src/status_im/ui/screens/desktop/main/views.cljs @@ -15,11 +15,8 @@ "Status.im"]]) (views/defview tab-views [] - (views/letsubs [{:keys [tab-view-id]} [:desktop/desktop]] - (let [component (case tab-view-id - react/view)] - [react/view {:style {:flex 1}} - [component]]))) + [react/view {:style {:flex 1}} + [react/view]]) (views/defview popup-view [] (views/letsubs [{:keys [popup]} [:desktop]]