Merge branch 'main' into feat/back-button
This commit is contained in:
commit
ce05be8c02
2 files changed
+43
-29
No files matched your search
@@ -119,27 +119,34 @@ pub fn ProviderContactPage() -> impl IntoView {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let mut toasts_context = expect_context::<ToastContext>();
|
let mut toasts_context = expect_context::<ToastContext>();
|
||||||
Effect::new(move || {
|
Effect::watch(
|
||||||
match submit_action.value().get() {
|
move || submit_action.value().get(),
|
||||||
Some(Ok(_)) => toasts_context.toast(
|
move |value, _, _| {
|
||||||
Toast::new()
|
log!("Running submit_action effect");
|
||||||
|
let Some(result) = value else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
let toast = match result {
|
||||||
|
Ok(_) => Toast::new()
|
||||||
.id(uuid::Uuid::new_v4())
|
.id(uuid::Uuid::new_v4())
|
||||||
.header("Submission Successful")
|
.header("Submission Successful")
|
||||||
.msg("You can go back or continue editing your responses.")
|
.msg("You can go back or continue editing your responses."),
|
||||||
),
|
Err(err) => Toast::new()
|
||||||
Some(Err(err)) => toasts_context.toast(
|
|
||||||
Toast::new()
|
|
||||||
.id(uuid::Uuid::new_v4())
|
.id(uuid::Uuid::new_v4())
|
||||||
.header("Submission Failed")
|
.header("Submission Failed")
|
||||||
.msg(err.to_string())
|
.msg(err.to_string())
|
||||||
),
|
};
|
||||||
_ => {}
|
|
||||||
}
|
untrack(move || {
|
||||||
|
submit_action.clear();
|
||||||
submit_action.clear();
|
toasts_context.toast(toast);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
// Display contact form.
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Display contact form.
|
||||||
view! {
|
view! {
|
||||||
<Banner title="R15 Scholarships" logo="/PHS_Stacked_Acronym.png" path="/" />
|
<Banner title="R15 Scholarships" logo="/PHS_Stacked_Acronym.png" path="/" />
|
||||||
<AuthLoaded fallback=Loading>
|
<AuthLoaded fallback=Loading>
|
||||||
|
|||||||
@@ -490,25 +490,32 @@ fn ScholarshipForm(
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Effect::new(move || {
|
Effect::watch(
|
||||||
match submit_action.value().get() {
|
move || submit_action.value().get(),
|
||||||
Some(Ok(_)) => toasts.toast(
|
move |value, _, _| {
|
||||||
Toast::new()
|
log!("Running submit_action effect");
|
||||||
|
let Some(result) = value else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
let toast = match result {
|
||||||
|
Ok(_) => Toast::new()
|
||||||
.id(uuid::Uuid::new_v4())
|
.id(uuid::Uuid::new_v4())
|
||||||
.header("Submission Successful")
|
.header("Submission Successful")
|
||||||
.msg("You can go back or continue editing your responses.")
|
.msg("You can go back or continue editing your responses."),
|
||||||
),
|
Err(err) => Toast::new()
|
||||||
Some(Err(err)) => toasts.toast(
|
|
||||||
Toast::new()
|
|
||||||
.id(uuid::Uuid::new_v4())
|
.id(uuid::Uuid::new_v4())
|
||||||
.header("Submission Failed")
|
.header("Submission Failed")
|
||||||
.msg(err.to_string())
|
.msg(err.to_string())
|
||||||
),
|
};
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
submit_action.clear();
|
untrack(move || {
|
||||||
});
|
submit_action.clear();
|
||||||
|
toasts.toast(toast);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user