Don't show the LES debug label if the network wasn't initialized just yet.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Igor Mandrigin 2018-11-27 13:17:58 +01:00
parent f5a0c2a7d9
commit 0547bfec0c
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
2 changed files with 9 additions and 2 deletions

View File

@ -12,6 +12,12 @@
:chain-sync-state :chain-sync-state
(fn [{:node/keys [chain-sync-state]} _] chain-sync-state)) (fn [{:node/keys [chain-sync-state]} _] chain-sync-state))
(re-frame/reg-sub
:current-network-initialized?
(fn [db _]
(let [network (get-in db [:account/account :networks (:network db)])]
(boolean network))))
(re-frame/reg-sub (re-frame/reg-sub
:current-network-uses-rpc? :current-network-uses-rpc?
(fn [db _] (fn [db _]

View File

@ -92,7 +92,8 @@
view-id [:get :view-id] view-id [:get :view-id]
sync-state [:chain-sync-state] sync-state [:chain-sync-state]
latest-block-number [:latest-block-number] latest-block-number [:latest-block-number]
rpc-network? [:current-network-uses-rpc?]] rpc-network? [:current-network-uses-rpc?]
network-initialized? [:current-network-initialized?]]
{:component-did-mount {:component-did-mount
(fn [this] (fn [this]
(let [[_ loading?] (.. this -props -argv)] (let [[_ loading?] (.. this -props -argv)]
@ -108,7 +109,7 @@
(true? old-loading?)) (true? old-loading?))
(re-frame/dispatch [:load-chats-messages]))))} (re-frame/dispatch [:load-chats-messages]))))}
[react/view styles/container [react/view styles/container
[toolbar show-welcome? (not rpc-network?) sync-state latest-block-number] [toolbar show-welcome? (and network-initialized? (not rpc-network?)) sync-state latest-block-number]
(cond show-welcome? (cond show-welcome?
[welcome view-id] [welcome view-id]
loading? loading?