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:
parent
38b94d7dce
commit
8369afdddc
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
(defn request-access-ios [then else]
|
(defn request-access-ios [then else]
|
||||||
(-> (.checkVideoAuthorizationStatus default-camera)
|
(-> (.checkVideoAuthorizationStatus default-camera)
|
||||||
(.then then)
|
(.then (fn [allowed?] (if allowed? (then) (else))))
|
||||||
(.catch else)))
|
(.catch else)))
|
||||||
|
|
||||||
(defn camera [props]
|
(defn camera [props]
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
[status-im.utils.ethereum.core :as ethereum]
|
[status-im.utils.ethereum.core :as ethereum]
|
||||||
[status-im.utils.ethereum.tokens :as tokens]
|
[status-im.utils.ethereum.tokens :as tokens]
|
||||||
[status-im.utils.platform :as platform]
|
[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]
|
(defn view-asset [symbol]
|
||||||
[react/view
|
[react/view
|
||||||
|
@ -157,7 +158,9 @@
|
||||||
|
|
||||||
(defn- request-camera-permissions []
|
(defn- request-camera-permissions []
|
||||||
(re-frame/dispatch [:request-permissions {:permissions [:camera]
|
(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?]
|
(defn- on-choose-recipient [contact-only?]
|
||||||
(list-selection/show {:title (i18n/label :t/wallet-choose-recipient)
|
(list-selection/show {:title (i18n/label :t/wallet-choose-recipient)
|
||||||
|
|
Loading…
Reference in New Issue