diff --git a/src/components/dashboard_button.rs b/src/components/dashboard_button.rs index 9558824..6bbd8ba 100644 --- a/src/components/dashboard_button.rs +++ b/src/components/dashboard_button.rs @@ -41,19 +41,16 @@ pub fn DashboardButton( diff --git a/src/components/login/provider.rs b/src/components/login/provider.rs index ce1fb6d..56a80ac 100644 --- a/src/components/login/provider.rs +++ b/src/components/login/provider.rs @@ -24,7 +24,5 @@ pub fn ProviderLoginContext() -> impl IntoView { "/providers/callback" ); - view! { - - } + view! { } } diff --git a/src/components/login/student.rs b/src/components/login/student.rs index f3b89df..14becf8 100644 --- a/src/components/login/student.rs +++ b/src/components/login/student.rs @@ -24,7 +24,5 @@ pub fn StudentLoginContext() -> impl IntoView { "/students/callback" ); - view! { - - } + view! { } } diff --git a/src/pages/provider_contact.rs b/src/pages/provider_contact.rs index f04271c..1275055 100644 --- a/src/pages/provider_contact.rs +++ b/src/pages/provider_contact.rs @@ -119,27 +119,34 @@ pub fn ProviderContactPage() -> impl IntoView { }); let mut toasts_context = expect_context::(); - Effect::new(move || { - match submit_action.value().get() { - Some(Ok(_)) => toasts_context.toast( - Toast::new() + Effect::watch( + move || submit_action.value().get(), + move |value, _, _| { + log!("Running submit_action effect"); + let Some(result) = value else { + return; + }; + + let toast = match result { + Ok(_) => Toast::new() .id(uuid::Uuid::new_v4()) .header("Submission Successful") - .msg("You can go back or continue editing your responses.") - ), - Some(Err(err)) => toasts_context.toast( - Toast::new() + .msg("You can go back or continue editing your responses."), + Err(err) => Toast::new() .id(uuid::Uuid::new_v4()) .header("Submission Failed") .msg(err.to_string()) - ), - _ => {} - } - - submit_action.clear(); - }); - - // Display contact form. + }; + + untrack(move || { + submit_action.clear(); + toasts_context.toast(toast); + }); + }, + false + ); + +// Display contact form. view! { diff --git a/src/pages/provider_portal.rs b/src/pages/provider_portal.rs index 8dc2018..3e6a869 100644 --- a/src/pages/provider_portal.rs +++ b/src/pages/provider_portal.rs @@ -20,11 +20,7 @@ pub fn ProviderPortal() -> impl IntoView { }); view! { - +
diff --git a/src/pages/scholarship_info.rs b/src/pages/scholarship_info.rs index 7a0628d..4948cd0 100644 --- a/src/pages/scholarship_info.rs +++ b/src/pages/scholarship_info.rs @@ -490,25 +490,32 @@ fn ScholarshipForm( }); }; - Effect::new(move || { - match submit_action.value().get() { - Some(Ok(_)) => toasts.toast( - Toast::new() + Effect::watch( + move || submit_action.value().get(), + move |value, _, _| { + log!("Running submit_action effect"); + let Some(result) = value else { + return; + }; + + let toast = match result { + Ok(_) => Toast::new() .id(uuid::Uuid::new_v4()) .header("Submission Successful") - .msg("You can go back or continue editing your responses.") - ), - Some(Err(err)) => toasts.toast( - Toast::new() + .msg("You can go back or continue editing your responses."), + Err(err) => Toast::new() .id(uuid::Uuid::new_v4()) .header("Submission Failed") .msg(err.to_string()) - ), - _ => {} - } + }; - submit_action.clear(); - }); + untrack(move || { + submit_action.clear(); + toasts.toast(toast); + }); + }, + false + ); //#endregion diff --git a/src/pages/test_page.rs b/src/pages/test_page.rs index 008676f..18b15af 100644 --- a/src/pages/test_page.rs +++ b/src/pages/test_page.rs @@ -33,8 +33,7 @@ pub fn TestPage() -> impl IntoView {

Important Dates

-
-
+