Add send logs button to exception dialog

This commit is contained in:
Roman Volosovskyi 2019-05-06 12:30:45 +03:00
parent 89643b425e
commit 543ccb69e8
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,8 @@
(ns status-im.utils.error-handler
(:require [clojure.string :as string]
[status-im.utils.utils :as utils]))
[status-im.utils.utils :as utils]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]))
;; Error handling code based on https://gist.github.com/pesterhazy/e6846be1b6712a9038537022d131ce46
@ -54,4 +56,8 @@
(handle-error e isFatal)
(if js/goog.DEBUG
(some-> orig-handler (.call nil e isFatal))
(utils/show-popup "Error" (.-message e))))))))
(utils/show-confirmation
{:title "Error"
:content (.-message e)
:confirm-button-text (i18n/label :t/send-logs)
:on-accept #(re-frame/dispatch [:logging.ui/send-logs-pressed])})))))))