0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

Add missing clear-mixin on login and register pages.

This commit is contained in:
Andrey Antukh 2017-02-21 18:07:07 +01:00
parent 0bb8fa7e06
commit 6f1c461e2e
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 7 additions and 14 deletions

View file

@ -22,12 +22,6 @@
(def form-data (forms/focus-data :login st/state))
(def set-value! (partial forms/set-value! st/store :login))
(defn- login-page-will-mount
[own]
(when @st/auth-ref
(st/emit! (rt/navigate :dashboard/projects)))
own)
(def +login-form+
{:email [forms/required forms/string]
:password [forms/required forms/string]})
@ -73,8 +67,11 @@
"Don't have an account?"]]]])))
(mx/defc login-page
{:mixins [mx/static]
:will-mount login-page-will-mount}
{:mixins [mx/static (forms/clear-mixin st/store :login)]
:will-mount (fn [own]
(when @st/auth-ref
(st/emit! (rt/navigate :dashboard/projects)))
own)}
[]
[:div.login
[:div.login-body

View file

@ -33,7 +33,8 @@
:password [forms/required forms/string]})
(mx/defc register-form
{:mixins [mx/static mx/reactive]}
{:mixins [mx/static mx/reactive
(forms/clear-mixin st/store :register)]}
[]
(let [data (mx/react form-data)
errors (mx/react form-errors)

View file

@ -39,17 +39,12 @@
(assoc f/identical-to :message "errors.form.identical-to"))
(def in-range f/in-range)
;; (def uuid-like f/uuid-like)
(def uuid f/uuid)
(def keyword f/keyword)
(def integer-str f/integer-str)
(def number-str f/number-str)
;; (def boolean-like f/boolean-like)
(def email f/email)
;; (def function f/function)
(def positive f/positive)
;; (def validate f/validate)
;; (def validate! f/validate!)
(def max-len
{:message "errors.form.max-len"