[fix] always show tokens that have a balance

- temporary fix before visible assets are fixed
- the problem is that you can't hide an asset with the way it currently
works, it will come back every time as long as there is a balance for it

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-05-21 19:08:48 +02:00
parent b6fecd4e1c
commit 4103591fe1
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
1 changed files with 4 additions and 4 deletions

View File

@ -383,8 +383,7 @@
chain (ethereum/chain-keyword db) chain (ethereum/chain-keyword db)
assets (get-in settings [:wallet :visible-tokens chain]) assets (get-in settings [:wallet :visible-tokens chain])
tokens (->> (tokens/tokens-for all-tokens chain) tokens (->> (tokens/tokens-for all-tokens chain)
(remove #(or (:hidden? %))) (remove #(or (:hidden? %))))]
(filter #((or assets identity) (:symbol %))))]
(when (not= network-status :offline) (when (not= network-status :offline)
(fx/merge (fx/merge
cofx cofx
@ -400,10 +399,11 @@
:tokens tokens :tokens tokens
:on-success :on-success
(fn [symbol balance] (fn [symbol balance]
(if assets (if (and assets
(assets symbol))
(re-frame/dispatch (re-frame/dispatch
[:wallet.callback/update-token-balance-success symbol balance]) [:wallet.callback/update-token-balance-success symbol balance])
;; NOTE: when there is no visible assets set, ;; NOTE: when there it is not a visible assets
;; we make an initialization round ;; we make an initialization round
(when (> balance 0) (when (> balance 0)
(re-frame/dispatch (re-frame/dispatch