-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
356 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(ns status-im.accounts.model | ||
(:require [status-im.utils.security :as security] | ||
[cljs.spec.alpha :as spec] | ||
[clojure.string :as string])) | ||
|
||
(defn logged-in? [cofx] | ||
(boolean | ||
(get-in cofx [:db :account/account]))) | ||
|
||
(defn credentials [cofx] | ||
(select-keys (get-in cofx [:db :accounts/login]) [:address :password :save-password?])) | ||
|
||
(defn account-creation-next-enabled? [{:keys [step password password-confirm name]}] | ||
(or (and password (= :enter-password step) (spec/valid? :status-im.accounts.db/password (security/safe-unmask-data password))) | ||
(and password-confirm (= :confirm-password step) (spec/valid? :status-im.accounts.db/password password-confirm)) | ||
(and name (= :enter-name step) (not (string/blank? name))))) | ||
|
||
(defn current-public-key | ||
[cofx] | ||
(get-in cofx [:db :account/account :public-key])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.