fix incoming/outgoing bug

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2020-05-08 14:01:55 +02:00
parent 5d11fb0549
commit 461e67a46b
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
5 changed files with 20 additions and 18 deletions

View File

@ -369,13 +369,16 @@
"keycard-multiacc?" keycard-multiaccount?) "keycard-multiacc?" keycard-multiaccount?)
(fx/merge cofx (fx/merge cofx
{:db (assoc db :auth-method auth-method)} {:db (assoc db :auth-method auth-method)}
#(case auth-method #(cond
keychain/auth-method-biometric (= auth-method
keychain/auth-method-biometric)
(biometric/biometric-auth %) (biometric/biometric-auth %)
keychain/auth-method-password (= auth-method
keychain/auth-method-password)
(get-credentials % key-uid) (get-credentials % key-uid)
;;nil or "none" or "biometric-prepare" ;;nil or "none" or "biometric-prepare"
:else
(open-login-callback % nil))))) (open-login-callback % nil)))))
(fx/defn biometric-auth-done (fx/defn biometric-auth-done

View File

@ -181,14 +181,13 @@
(str amount-fiat " " code)]]])) (str amount-fiat " " code)]]]))
(defn calculate-direction [outgoing command-state] (defn calculate-direction [outgoing command-state]
(case command-state (if (#{constants/command-state-request-address-for-transaction-accepted
(constants/command-state-request-address-for-transaction-accepted
constants/command-state-request-address-for-transaction-declined constants/command-state-request-address-for-transaction-declined
constants/command-state-request-transaction) constants/command-state-request-transaction} command-state)
(if outgoing :incoming :outgoing) (if outgoing :incoming :outgoing)
(if outgoing :outgoing :incoming))) (if outgoing :outgoing :incoming)))
(defn comand-content (defn command-content
[wrapper {:keys [message-id [wrapper {:keys [message-id
chat-id chat-id
outgoing outgoing

View File

@ -269,14 +269,14 @@
(defn chat-message [{:keys [content content-type] :as message}] (defn chat-message [{:keys [content content-type] :as message}]
(if (= content-type constants/content-type-command) (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) (if (= content-type constants/content-type-system-text)
[system-message-content-wrapper message [system-text-message message]] [system-message-content-wrapper message [system-text-message message]]
[react/touchable-highlight (message-press-handlers message) [react/touchable-highlight (message-press-handlers message)
[message-content-wrapper [message-content-wrapper
message message
(if (= content-type constants/content-type-text) (if (= content-type constants/content-type-text)
; text message ;; text message
[text-message message] [text-message message]
(if (= content-type constants/content-type-status) (if (= content-type constants/content-type-status)
[message-content-status message] [message-content-status message]

View File

@ -2,6 +2,7 @@
(:require-macros [status-im.utils.views :as views]) (:require-macros [status-im.utils.views :as views])
(:require [re-frame.core :as re-frame] (:require [re-frame.core :as re-frame]
[status-im.i18n :as i18n] [status-im.i18n :as i18n]
[status-im.constants :as constants]
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
[status-im.ui.components.list.views :as list] [status-im.ui.components.list.views :as list]
[status-im.ui.components.colors :as colors] [status-im.ui.components.colors :as colors]
@ -22,9 +23,11 @@
(defn prepare-items-manage [name] (defn prepare-items-manage [name]
(fn [permission] (fn [permission]
{:title (case permission {:title (cond
constants/dapp-permission-web3 name (= permission constants/dapp-permission-web3)
constants/dapp-permission-contact-code :t/contact-code) name
(= permission constants/dapp-permission-contact-code)
:t/contact-code)
:type :small :type :small
:accessories [:main-icons/check]})) :accessories [:main-icons/check]}))

View File

@ -15,11 +15,8 @@
"Status.im"]]) "Status.im"]])
(views/defview tab-views [] (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}} [react/view {:style {:flex 1}}
[component]]))) [react/view]])
(views/defview popup-view [] (views/defview popup-view []
(views/letsubs [{:keys [popup]} [:desktop]] (views/letsubs [{:keys [popup]} [:desktop]]