[#10418] Can login to account just via tap upon it from `Your keys` view

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2020-04-27 13:00:35 +02:00
parent f73754af34
commit 0a4547e652
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
1 changed files with 3 additions and 2 deletions

View File

@ -35,9 +35,10 @@
(fx/defn initialize-views
{:events [::initialize-view]}
[cofx {:keys [logout?]}]
(let [{{:multiaccounts/keys [multiaccounts] :as db} :db} cofx]
(let [{{:multiaccounts/keys [multiaccounts]} :db} cofx]
(when (and (seq multiaccounts) (not logout?))
(let [{:keys [key-uid public-key photo-path name]} (first (#(sort-by :last-sign-in > %) (vals multiaccounts)))]
(let [{:keys [key-uid public-key photo-path name]}
(first (sort-by :timestamp > (vals multiaccounts)))]
(multiaccounts.login/open-login cofx key-uid photo-path name public-key)))))
(fx/defn initialize-multiaccounts