update open-login-callback after fx/def macro fix

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
tbenr 2019-06-01 19:28:34 +02:00 committed by Andrey Shovkoplyas
parent 34300cc0c0
commit e93906c0d9
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
3 changed files with 15 additions and 13 deletions

View File

@ -558,4 +558,6 @@ var TopLevel = {
"FIRSTWEEKCUTOFFDAY": function () {},
"decimalPlaces": function () {},
"_android": function () {},
"isSupported" : function () {},
"authenticate" : function () {},
}

View File

@ -10,7 +10,8 @@
(def status-keycard (js-require/js-require "react-native-status-keycard"))
(def realm (js/require "realm"))
(def webview-bridge (js-require/js-require "react-native-webview-bridge"))
(defn touchid [] (.-default (js/require "react-native-touch-id")))
(def touchid-class (js-require/js-require "react-native-touch-id"))
(defn touchid [] (.-default (touchid-class)))
(def webview (js-require/js-require "react-native-webview"))
(def securerandom (js-require/js-require "react-native-securerandom"))
(defn secure-random [] (.-generateSecureRandom (securerandom)))

View File

@ -317,18 +317,17 @@
(fx/defn open-login-callback
{:events [:accounts.login.callback/biometric-auth-done]}
[{:keys [db] :as cofx} password biometric-auth-result]
(let [{:keys [bioauth-success bioauth-notrequired bioauth-message]} biometric-auth-result]
(if (and password
(or bioauth-success bioauth-notrequired))
(fx/merge cofx
{:db (assoc-in db [:accounts/login :password] password)}
(navigation/navigate-to-cofx :progress nil)
(user-login false))
(fx/merge cofx
(when bioauth-message
{:utils/show-popup {:title (i18n/label :t/biometric-auth-login-error-title) :content bioauth-message}})
(navigation/navigate-to-cofx :login nil)))))
[{:keys [db] :as cofx} password {:keys [bioauth-success bioauth-notrequired bioauth-message]}]
(if (and password
(or bioauth-success bioauth-notrequired))
(fx/merge cofx
{:db (assoc-in db [:accounts/login :password] password)}
(navigation/navigate-to-cofx :progress nil)
(user-login false))
(fx/merge cofx
(when bioauth-message
{:utils/show-popup {:title (i18n/label :t/biometric-auth-login-error-title) :content bioauth-message}})
(navigation/navigate-to-cofx :login nil))))
(fx/defn do-biometric-auth
[{:keys [db] :as cofx} password]