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)