Moved pending username to new global state
Some checks failed
Build Crate / build (push) Failing after 1m45s

This commit is contained in:
2024-08-30 03:38:02 -04:00
parent 8be43c95d4
commit 659037ec00
4 changed files with 14 additions and 12 deletions

View File

@@ -60,10 +60,10 @@ fn login_form_capsule<G: Html>(
) -> View<G> {
// If there's a tentative username, set it
let global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
if let Some(username) = (*global_state.auth.username.get()).clone() {
state.username.set(username);
global_state.auth.username.set(None);
}
state
.username
.set((*global_state.auth.pending_username.get()).clone());
global_state.auth.pending_username.set(String::new());
let close_modal = move |_event: Event| {
#[cfg(client)]
@@ -85,8 +85,8 @@ fn login_form_capsule<G: Html>(
// Update tentative username
global_state
.auth
.username
.set(Some((*state.username.get()).clone()));
.pending_username
.set((*state.username.get()).clone());
// Open new modal
global_state