improve: enable collect logs before login (#16392)

This commit is contained in:
frank 2023-06-27 07:42:53 +08:00 committed by GitHub
parent e2b7a299b4
commit ab16ca34dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,8 @@
[utils.datetime :as datetime]
[status-im.utils.platform :as platform]
[status-im.utils.types :as types]
[status-im2.common.log :as log]))
[status-im2.common.log :as log]
[status-im2.config :as config]))
(def report-email "error-reports@status.im")
@ -96,8 +97,11 @@
(re-frame/dispatch [:show-client-error]))))))
(defn logs-enabled?
[db]
(not (string/blank? (get-in db [:multiaccount :log-level]))))
[{:keys [multiaccount]}]
(let [log-level (if multiaccount ;; already login
(get multiaccount :log-level)
config/log-level)]
(not (string/blank? log-level))))
(rf/defn send-logs
{:events [:logging.ui/send-logs-pressed]}