Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed Sep 15, 2022
1 parent 5da68d1 commit 894d07f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/status_im/network/net_info.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
[{:keys [db] :as cofx} is-connected?]
(fx/merge cofx
{:db (assoc db :network-status (if is-connected? :online :offline))}
(when is-connected?
(wallet-connect-legacy/get-connector-session-from-db))
(when (and is-connected?
(or (not= (count (get-in db [:wallet :accounts]))
(count (get db :multiaccount/accounts)))
Expand All @@ -32,18 +34,14 @@
old-network-type (:network/type db)
connectivity-status (if isConnected :online :offline)
status-changed? (not= connectivity-status old-network-status)
type-changed? (= type old-network-type)
online? (= connectivity-status :online)]
type-changed? (= type old-network-type)]
(log/debug "[net-info]"
"old-network-status" old-network-status
"old-network-type" old-network-type
"connectivity-status" connectivity-status
"type" type
"details" details)
(fx/merge cofx
(when (and status-changed?
online?)
(wallet-connect-legacy/get-connector-session-from-db))
(when status-changed?
(change-network-status isConnected))
(when-not type-changed?
Expand Down

0 comments on commit 894d07f

Please sign in to comment.