From 9a2ba3009d0f14f1f092c0a535dfa2a4a4ecf040 Mon Sep 17 00:00:00 2001 From: yenda Date: Fri, 13 Sep 2019 16:09:36 +0200 Subject: [PATCH] fix log level config the log level config for status-go wasn't saved in the node-config as a result even though the setting looked applied in the UI it wasn't in the node --- src/status_im/log_level/core.cljs | 9 +++++---- src/status_im/node/core.cljs | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/status_im/log_level/core.cljs b/src/status_im/log_level/core.cljs index 62911ef30b..0a7b74a4e3 100644 --- a/src/status_im/log_level/core.cljs +++ b/src/status_im/log_level/core.cljs @@ -12,10 +12,11 @@ new-settings (if log-level (assoc settings :log-level log-level) (dissoc settings :log-level))] - (multiaccounts.update/update-settings cofx - new-settings - (when (not= (node/get-log-level settings) (node/get-log-level new-settings)) - {:success-event [:multiaccounts.update.callback/save-settings-success]})))) + (fx/merge cofx + (multiaccounts.update/update-settings new-settings + {}) + (node/prepare-new-config {:on-success #(when (not= (node/get-log-level settings) (node/get-log-level new-settings)) + (re-frame/dispatch [:logout]))})))) (fx/defn show-change-log-level-confirmation [{:keys [db]} {:keys [name value] :as log-level}] diff --git a/src/status_im/node/core.cljs b/src/status_im/node/core.cljs index e1195a4212..804f00647d 100644 --- a/src/status_im/node/core.cljs +++ b/src/status_im/node/core.cljs @@ -169,6 +169,10 @@ (types/clj->json (get-multiaccount-node-config db))) (fx/defn save-new-config + "Saves a new status-go config for the current account + This RPC method is the only way to change the node config of an account. + NOTE: it is better used indirectly through `prepare-new-config`, which will take + care of building up the proper config based on settings in app-db" {:events [::save-new-config]} [{:keys [db]} config {:keys [on-success]}] {::json-rpc/call [{:method "settings_saveNodeConfig" @@ -176,6 +180,7 @@ :on-success on-success}]}) (fx/defn prepare-new-config + "Use this function to apply settings to the current account node config" [{:keys [db]} {:keys [on-success]}] {::prepare-new-config [(get-new-config db) #(re-frame/dispatch [::save-new-config % {:on-success on-success}])]})