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 ff3f171646
commit 79bded1023
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 :group-chat true
:contacts #{} :contacts #{}
:public? true :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 :unviewed-messages-count 0
:loaded-unviewed-messages-ids #{}} :loaded-unviewed-messages-ids #{}}
nil)) nil))

View File

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

View File

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