Fixes #3417: App crashed when accessing camera view but access to camera denied for app [iOS]

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Oleg Kilimnik 2018-05-11 02:46:39 +03:00 committed by Julien Eluard
parent 38b94d7dce
commit 8369afdddc
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
2 changed files with 6 additions and 3 deletions

View File

@ -22,7 +22,7 @@
(defn request-access-ios [then else]
(-> (.checkVideoAuthorizationStatus default-camera)
(.then then)
(.then (fn [allowed?] (if allowed? (then) (else))))
(.catch else)))
(defn camera [props]

View File

@ -21,7 +21,8 @@
[status-im.utils.ethereum.core :as ethereum]
[status-im.utils.ethereum.tokens :as tokens]
[status-im.utils.platform :as platform]
[status-im.ui.components.tooltip.views :as tooltip]))
[status-im.ui.components.tooltip.views :as tooltip]
[status-im.utils.utils :as utils]))
(defn view-asset [symbol]
[react/view
@ -157,7 +158,9 @@
(defn- request-camera-permissions []
(re-frame/dispatch [:request-permissions {:permissions [:camera]
:on-allowed #(re-frame/dispatch [:navigate-to :recipient-qr-code])}]))
:on-allowed #(re-frame/dispatch [:navigate-to :recipient-qr-code])
:on-denied #(utils/show-popup (i18n/label :t/error)
(i18n/label :t/camera-access-error))}]))
(defn- on-choose-recipient [contact-only?]
(list-selection/show {:title (i18n/label :t/wallet-choose-recipient)