Fix coming back from offline

Fixes: #11305

The issue was due to the fact that the first condition was wrapped in a
when in fx merge, causing it to be ignored.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-10-19 15:10:00 +02:00
parent 81cfc83ed3
commit b826a34f27
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
3 changed files with 4 additions and 4 deletions

View File

@ -170,7 +170,7 @@
:group-chat true
:contacts #{}
:public? true
:might-have-join-time-messages? (get-in cofx [:multiaccount :use-mailservers?])
:might-have-join-time-messages? (get-in cofx [:db :multiaccount :use-mailservers?])
:unviewed-messages-count 0
:loaded-unviewed-messages-ids #{}}
nil))

View File

@ -244,8 +244,8 @@
use-mailservers? (fetch-use-mailservers? cofx)
added? (registered-peer? peers-summary address)
gap-request? (executing-gap-request? db)]
(fx/merge cofx
(when use-mailservers?
(when use-mailservers?
(fx/merge cofx
{:db (cond-> (dissoc db :mailserver/current-request)
gap-request?
(-> (assoc :mailserver/fetching-gaps-in-progress {})

View File

@ -637,7 +637,7 @@
(testing "it returns noops when use-mailservers? is false"
(let [no-mailservers-cofx {:db (assoc-in db [:multiaccount :use-mailservers?] false)}]
(is (= (mailserver/connect-to-mailserver no-mailservers-cofx)
no-mailservers-cofx))))))
nil))))))
(deftest check-existing-gaps
(testing "no gaps"