mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
Do not update :mailserver/connection-checks` if the user is logged out.
Connection check should be skipped if the user has logged out, otherwise `app-db` may end up in an invalid state which causes an error and red screen in dev mode.
This commit is contained in:
parent
c810e0f2c3
commit
e20af4d206
@ -364,12 +364,14 @@
|
|||||||
else
|
else
|
||||||
change mailserver if mailserver is connected"
|
change mailserver if mailserver is connected"
|
||||||
[{:keys [db] :as cofx}]
|
[{:keys [db] :as cofx}]
|
||||||
(if (zero? (dec (:mailserver/connection-checks db)))
|
;; check if logged into account
|
||||||
(fx/merge cofx
|
(when (contains? db :account/account)
|
||||||
{:db (dissoc db :mailserver/connection-checks)}
|
(if (zero? (dec (:mailserver/connection-checks db)))
|
||||||
(when (= :connecting (:mailserver/state db))
|
(fx/merge cofx
|
||||||
(change-mailserver cofx)))
|
{:db (dissoc db :mailserver/connection-checks)}
|
||||||
{:db (update db :mailserver/connection-checks dec)}))
|
(when (= :connecting (:mailserver/state db))
|
||||||
|
(change-mailserver cofx)))
|
||||||
|
{:db (update db :mailserver/connection-checks dec)})))
|
||||||
|
|
||||||
(fx/defn reset-request-to
|
(fx/defn reset-request-to
|
||||||
[{:keys [db]}]
|
[{:keys [db]}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user