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
This commit is contained in:
parent
49d882ba29
commit
9a2ba3009d
|
@ -12,10 +12,11 @@
|
||||||
new-settings (if log-level
|
new-settings (if log-level
|
||||||
(assoc settings :log-level log-level)
|
(assoc settings :log-level log-level)
|
||||||
(dissoc settings :log-level))]
|
(dissoc settings :log-level))]
|
||||||
(multiaccounts.update/update-settings cofx
|
(fx/merge cofx
|
||||||
new-settings
|
(multiaccounts.update/update-settings new-settings
|
||||||
(when (not= (node/get-log-level settings) (node/get-log-level new-settings))
|
{})
|
||||||
{:success-event [:multiaccounts.update.callback/save-settings-success]}))))
|
(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
|
(fx/defn show-change-log-level-confirmation
|
||||||
[{:keys [db]} {:keys [name value] :as log-level}]
|
[{:keys [db]} {:keys [name value] :as log-level}]
|
||||||
|
|
|
@ -169,6 +169,10 @@
|
||||||
(types/clj->json (get-multiaccount-node-config db)))
|
(types/clj->json (get-multiaccount-node-config db)))
|
||||||
|
|
||||||
(fx/defn save-new-config
|
(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]}
|
{:events [::save-new-config]}
|
||||||
[{:keys [db]} config {:keys [on-success]}]
|
[{:keys [db]} config {:keys [on-success]}]
|
||||||
{::json-rpc/call [{:method "settings_saveNodeConfig"
|
{::json-rpc/call [{:method "settings_saveNodeConfig"
|
||||||
|
@ -176,6 +180,7 @@
|
||||||
:on-success on-success}]})
|
:on-success on-success}]})
|
||||||
|
|
||||||
(fx/defn prepare-new-config
|
(fx/defn prepare-new-config
|
||||||
|
"Use this function to apply settings to the current account node config"
|
||||||
[{:keys [db]} {:keys [on-success]}]
|
[{:keys [db]} {:keys [on-success]}]
|
||||||
{::prepare-new-config [(get-new-config db)
|
{::prepare-new-config [(get-new-config db)
|
||||||
#(re-frame/dispatch [::save-new-config % {:on-success on-success}])]})
|
#(re-frame/dispatch [::save-new-config % {:on-success on-success}])]})
|
||||||
|
|
Loading…
Reference in New Issue