[#8107] Wallet balance is not updated when transaction is received
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
441989f168
commit
f3b6f98079
|
@ -164,7 +164,11 @@
|
||||||
[react/scroll-view {:end-fill-color colors/white
|
[react/scroll-view {:end-fill-color colors/white
|
||||||
:refresh-control
|
:refresh-control
|
||||||
(reagent/as-element
|
(reagent/as-element
|
||||||
[react/refresh-control {:on-refresh #(re-frame/dispatch [:wallet.ui/pull-to-refresh])
|
[react/refresh-control {:on-refresh (fn [_]
|
||||||
|
;;TODO temporay fix to update balance, should be fixed
|
||||||
|
;;properly later
|
||||||
|
(re-frame/dispatch [:wallet.ui/pull-to-refresh])
|
||||||
|
(re-frame/dispatch [:update-wallet]))
|
||||||
:tint-color :white
|
:tint-color :white
|
||||||
:refreshing false}])}
|
:refreshing false}])}
|
||||||
(if error-message
|
(if error-message
|
||||||
|
|
|
@ -2,16 +2,27 @@
|
||||||
(:require [re-frame.core :as re-frame]
|
(:require [re-frame.core :as re-frame]
|
||||||
[status-im.ui.screens.navigation :as navigation]
|
[status-im.ui.screens.navigation :as navigation]
|
||||||
[status-im.utils.ethereum.core :as ethereum]
|
[status-im.utils.ethereum.core :as ethereum]
|
||||||
[status-im.constants :as constants]))
|
[status-im.constants :as constants]
|
||||||
|
[status-im.utils.utils :as utils]))
|
||||||
|
|
||||||
(defmethod navigation/preload-data! :wallet
|
(defmethod navigation/preload-data! :wallet
|
||||||
[db _]
|
[db _]
|
||||||
;;TODO(goranjovic) - get rid of this preload hook completely
|
;;TODO(goranjovic) - get rid of this preload hook completely
|
||||||
|
;;TODO(andrey) - temporary "improvement" with timeout, to fix screen rendering, wallet update should be optimized
|
||||||
|
(utils/set-timeout (fn []
|
||||||
|
(re-frame/dispatch [:wallet.ui/pull-to-refresh])
|
||||||
|
(re-frame/dispatch [:update-wallet]))
|
||||||
|
500)
|
||||||
(assoc-in db [:wallet :current-tab] 0))
|
(assoc-in db [:wallet :current-tab] 0))
|
||||||
|
|
||||||
(defmethod navigation/preload-data! :wallet-stack
|
(defmethod navigation/preload-data! :wallet-stack
|
||||||
[db _]
|
[db _]
|
||||||
;;TODO(goranjovic) - get rid of this preload hook completely
|
;;TODO(goranjovic) - get rid of this preload hook completely
|
||||||
|
;;TODO(andrey) - temporary "improvement" with timeout, to fix screen rendering, wallet update should be optimized
|
||||||
|
(utils/set-timeout (fn []
|
||||||
|
(re-frame/dispatch [:wallet.ui/pull-to-refresh])
|
||||||
|
(re-frame/dispatch [:update-wallet]))
|
||||||
|
500)
|
||||||
(assoc-in db [:wallet :current-tab] 0))
|
(assoc-in db [:wallet :current-tab] 0))
|
||||||
|
|
||||||
(defmethod navigation/preload-data! :transactions-history
|
(defmethod navigation/preload-data! :transactions-history
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
[status-im.utils.money :as money]
|
[status-im.utils.money :as money]
|
||||||
[status-im.utils.ethereum.tokens :as tokens]
|
[status-im.utils.ethereum.tokens :as tokens]
|
||||||
[status-im.utils.ethereum.core :as ethereum]
|
[status-im.utils.ethereum.core :as ethereum]
|
||||||
[status-im.ui.screens.wallet.utils :as wallet.utils]))
|
[status-im.ui.screens.wallet.utils :as wallet.utils]
|
||||||
|
[status-im.utils.utils :as utils]))
|
||||||
|
|
||||||
(defn history-action [filter?]
|
(defn history-action [filter?]
|
||||||
(cond->
|
(cond->
|
||||||
|
@ -254,7 +255,9 @@
|
||||||
[react/view {:style components.styles/flex}
|
[react/view {:style components.styles/flex}
|
||||||
[status-bar/status-bar]
|
[status-bar/status-bar]
|
||||||
[toolbar/toolbar {}
|
[toolbar/toolbar {}
|
||||||
toolbar/default-nav-back
|
[toolbar/nav-button (actions/back
|
||||||
|
;;TODO temporary fix to update wallet balance, should be fixed properly later
|
||||||
|
(utils/set-timeout #(re-frame/dispatch [:update-wallet]) 500))]
|
||||||
[toolbar/content-title (i18n/label :t/transaction-details)]
|
[toolbar/content-title (i18n/label :t/transaction-details)]
|
||||||
(when transaction [toolbar/actions (details-action hash url)])]
|
(when transaction [toolbar/actions (details-action hash url)])]
|
||||||
[react/scroll-view {:style components.styles/main-container}
|
[react/scroll-view {:style components.styles/main-container}
|
||||||
|
@ -262,3 +265,4 @@
|
||||||
[details-confirmations confirmations confirmations-progress type]
|
[details-confirmations confirmations confirmations-progress type]
|
||||||
[react/view {:style styles/details-separator}]
|
[react/view {:style styles/details-separator}]
|
||||||
[details-list transaction]]]))
|
[details-list transaction]]]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue