Fix hydration bug

This commit is contained in:
Yash Karandikar 2022-02-07 18:43:03 -06:00
parent 44d3437174
commit f44ee01df4

View file

@ -209,7 +209,7 @@ pub fn register() -> View<G> {
let password_raw = Signal::new(String::new());
let password_confirm = Signal::new(String::new());
let error_blank = Signal::new(true);
let error_blank = Signal::new(false);
let error_passmatch = Signal::new(false);
let on_click = cloned!((error_blank, error_passmatch, username, password_raw, password_confirm) => move |_| {
@ -233,6 +233,7 @@ pub fn register() -> View<G> {
input(bind:value=password_confirm)
}
div {
(if *error_passmatch.get() {
view! {
p(style="color: red") { "Passwords do not match" }
@ -240,6 +241,8 @@ pub fn register() -> View<G> {
} else {
view! {}
})
}
div {
(if *error_blank.get() {
view! {
p(style="color: red") { "Invalid form input. Make sure none of the fields are empty." }
@ -247,6 +250,7 @@ pub fn register() -> View<G> {
} else {
view! {}
})
}
div(style="justify-content: right") {
button(on:click=on_click) { "Register" }