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
|
||||
change mailserver if mailserver is connected"
|
||||
[{:keys [db] :as cofx}]
|
||||
(if (zero? (dec (:mailserver/connection-checks db)))
|
||||
(fx/merge cofx
|
||||
{:db (dissoc db :mailserver/connection-checks)}
|
||||
(when (= :connecting (:mailserver/state db))
|
||||
(change-mailserver cofx)))
|
||||
{:db (update db :mailserver/connection-checks dec)}))
|
||||
;; check if logged into account
|
||||
(when (contains? db :account/account)
|
||||
(if (zero? (dec (:mailserver/connection-checks db)))
|
||||
(fx/merge cofx
|
||||
{:db (dissoc db :mailserver/connection-checks)}
|
||||
(when (= :connecting (:mailserver/state db))
|
||||
(change-mailserver cofx)))
|
||||
{:db (update db :mailserver/connection-checks dec)})))
|
||||
|
||||
(fx/defn reset-request-to
|
||||
[{:keys [db]}]
|
||||
|
|
Loading…
Reference in New Issue