From 707cf82b8b0bfb5dab036155dd5c9e39f32bc1ab Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Wed, 8 Jun 2022 17:34:03 +0100 Subject: [PATCH] Use status-go settings for contact requests https://github.com/status-im/status-go/compare/09ba88c1...cc80f575 Signed-off-by: Andrea Maria Piana --- src/status_im/contact/core.cljs | 11 +++++++---- src/status_im/multiaccounts/login/core.cljs | 12 ------------ src/status_im/subs.cljs | 8 +++++++- status-go-version.json | 6 +++--- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/status_im/contact/core.cljs b/src/status_im/contact/core.cljs index 2dfe01d071..0003643c7d 100644 --- a/src/status_im/contact/core.cljs +++ b/src/status_im/contact/core.cljs @@ -4,8 +4,8 @@ [status-im.data-store.contacts :as contacts-store] [status-im.ethereum.json-rpc :as json-rpc] [status-im.navigation :as navigation] + [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.utils.fx :as fx] - [status-im.async-storage.core :as async-storage] [taoensso.timbre :as log] [status-im.constants :as constants] [status-im.contact.block :as contact.block])) @@ -144,6 +144,9 @@ (fx/defn switch-mutual-contact-requests-enabled {:events [:multiaccounts.ui/switch-mutual-contact-requests-enabled]} - [{:keys [db]} enabled?] - {::async-storage/set! {:mutual-contact-requests-enabled? enabled?} - :db (assoc db :mutual-contact-requests/enabled? enabled?)}) + [cofx enabled?] + (multiaccounts.update/multiaccount-update + cofx + :mutual-contact-enabled? + enabled? + nil)) diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 6f4a7070fc..689fa8fe8f 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -94,13 +94,6 @@ :wallet-connect-enabled? #(re-frame/dispatch [:multiaccounts.ui/switch-wallet-connect-enabled %])))) -(re-frame/reg-fx - ::initialize-mutual-contact-requests - (fn [] - (async-storage/get-item - :mutual-contact-requests-enabled? - #(re-frame/dispatch [:multiaccounts.ui/switch-mutual-contact-requests-enabled %])))) - (defn rpc->accounts [accounts] (reduce (fn [acc {:keys [chat type wallet] :as account}] (if chat @@ -366,10 +359,6 @@ [cofx] {::initialize-wallet-connect nil}) -(fx/defn initialize-mutual-contact-requests - [cofx] - {::initialize-mutual-contact-requests nil}) - (fx/defn get-node-config-callback {:events [::get-node-config-callback]} [{:keys [db] :as cofx} node-config-json] @@ -404,7 +393,6 @@ (initialize-appearance) (initialize-communities-enabled) (initialize-wallet-connect) - (initialize-mutual-contact-requests) (get-node-config) (communities/fetch) (logging/set-log-level (:log-level multiaccount)) diff --git a/src/status_im/subs.cljs b/src/status_im/subs.cljs index 6efad4d464..baa64b7c76 100644 --- a/src/status_im/subs.cljs +++ b/src/status_im/subs.cljs @@ -267,10 +267,10 @@ (reg-root-key-sub :wallet-connect/session-managed :wallet-connect/session-managed) (reg-root-key-sub :contact-requests/pending :contact-requests/pending) -(reg-root-key-sub :mutual-contact-requests/enabled? :mutual-contact-requests/enabled?) ; Testing + (reg-root-key-sub :messenger/started? :messenger/started?) (re-frame/reg-sub @@ -2256,6 +2256,12 @@ (fn [multiaccount] (get multiaccount :profile-pictures-show-to))) +(re-frame/reg-sub + :mutual-contact-requests/enabled? + :<- [:multiaccount] + (fn [settings] + (boolean (:mutual-contact-enabled? settings)))) + (re-frame/reg-sub ::profile-pictures-visibility :<- [:multiaccount] diff --git a/status-go-version.json b/status-go-version.json index 66083cdc6e..c4a9135ac2 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.101.0", - "commit-sha1": "09ba88c19dc36c88d22e880d6568e4fe4861ddc3", - "src-sha256": "178p268kj5n0qzsw8i20zgip34q1rrxa7l7j3gib6ai3a30p6zif" + "version": "v0.101.1", + "commit-sha1": "cc80f5753baf4701cfabcde8d01c2e8b9deebd6f", + "src-sha256": "1sc4a8qnmb64dn0x9s4r1m42dwzr70jh2mzgyhn2mavx33abr8kn" }