diff --git a/src/status_im/ui/components/permissions.cljs b/src/status_im/ui/components/permissions.cljs index cd06473166..18b9fb5bea 100644 --- a/src/status_im/ui/components/permissions.cljs +++ b/src/status_im/ui/components/permissions.cljs @@ -14,7 +14,7 @@ (defn all-granted? [permissions] (let [permission-vals (distinct (vals permissions))] (and (= (count permission-vals) 1) - (not= (first permission-vals) "denied")))) + (not (#{"denied" "never_ask_again"} (first permission-vals)))))) (defn request-permissions [{:keys [permissions on-allowed on-denied] :or {on-allowed #() diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index 8353c773be..8ae495a628 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -53,8 +53,11 @@ :action (fn [] (re-frame/dispatch [:request-permissions {:permissions [:camera :write-external-storage] :on-allowed #(re-frame/dispatch [:navigate-to :profile-photo-capture]) - :on-denied #(utils/show-popup (i18n/label :t/error) - (i18n/label :t/camera-access-error))}]))}]) + :on-denied (fn [] + (utils/set-timeout + #(utils/show-popup (i18n/label :t/error) + (i18n/label :t/camera-access-error)) + 50))}]))}]) (defn qr-viewer-toolbar [label value] [toolbar/toolbar {} diff --git a/src/status_im/ui/screens/qr_scanner/events.cljs b/src/status_im/ui/screens/qr_scanner/events.cljs index c279273780..ac97ac1fdc 100644 --- a/src/status_im/ui/screens/qr_scanner/events.cljs +++ b/src/status_im/ui/screens/qr_scanner/events.cljs @@ -8,11 +8,14 @@ (handlers/register-handler-fx :scan-qr-code (fn [{:keys [db]} [_ identifier handler]] - {:db (assoc-in db [:qr-codes identifier] handler) + {:db (assoc-in db [:qr-codes identifier] handler) :request-permissions-fx {:permissions [:camera] :on-allowed #(re-frame/dispatch [:navigate-to :qr-scanner {:current-qr-context identifier}]) - :on-denied #(utils/show-popup (i18n/label :t/error) - (i18n/label :t/camera-access-error))}})) + :on-denied (fn [] + (utils/set-timeout + #(utils/show-popup (i18n/label :t/error) + (i18n/label :t/camera-access-error)) + 50))}})) (handlers/register-handler-fx :clear-qr-code diff --git a/src/status_im/ui/screens/wallet/components/views.cljs b/src/status_im/ui/screens/wallet/components/views.cljs index 59bc48d081..3749adea2b 100644 --- a/src/status_im/ui/screens/wallet/components/views.cljs +++ b/src/status_im/ui/screens/wallet/components/views.cljs @@ -163,8 +163,11 @@ (defn- request-camera-permissions [] (re-frame/dispatch [:request-permissions {:permissions [:camera] :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))}])) + :on-denied #(utils/set-timeout + (fn [] + (utils/show-popup (i18n/label :t/error) + (i18n/label :t/camera-access-error))) + 50)}])) (defn- on-choose-recipient [contact-only?] (list-selection/show {:title (i18n/label :t/wallet-choose-recipient)