diff --git a/crates/ascend/src/pages/wall.rs b/crates/ascend/src/pages/wall.rs
index 40aa34e..06889f8 100644
--- a/crates/ascend/src/pages/wall.rs
+++ b/crates/ascend/src/pages/wall.rs
@@ -70,6 +70,7 @@ pub fn Wall() -> impl IntoView {
let wall = wall.await?;
let problems = problems.await?;
let user_interactions = user_interactions.await?;
+ let user_interactions = RwSignal::new(user_interactions);
let v = view! { };
Ok::<_, ServerFnError>(v)
})}
@@ -92,7 +93,7 @@ fn WithProblem(#[prop(into)] problem: Signal) -> impl IntoView
fn WithWall(
#[prop(into)] wall: Signal,
#[prop(into)] problems: Signal>,
- #[prop(into)] user_interactions: Signal>,
+ #[prop(into)] user_interactions: RwSignal>,
) -> impl IntoView {
tracing::trace!("Enter");
@@ -100,8 +101,21 @@ fn WithWall(
let (problem_uid, set_problem_uid) = leptos_router::hooks::query_signal::("problem");
+ let submit_attempt = ServerAction::>::new();
+ Effect::new(move || {
+ if let Some(Ok(v)) = submit_attempt.value().get() {
+ let v = v.into_inner();
+ user_interactions.update(|map| {
+ map.insert(v.problem_uid, v);
+ });
+ }
+ });
+ let submit_attempt_cb = StoredValue::new(move |attempt: server_functions::UpsertTodaysAttempt| {
+ submit_attempt.dispatch(RonEncoded(attempt));
+ });
+
let problem = signals::problem(problems, problem_uid.into());
- let user_interaction = signals::user_interaction(user_interactions, problem_uid.into());
+ let user_interaction = signals::user_interaction(user_interactions.into(), problem_uid.into());
// Filter
let (filter_holds, set_filter_holds) = signal(BTreeSet::new());
@@ -154,16 +168,9 @@ fn WithWall(
});
};
- let grid = view! {
-
- {move || {
- Suspend::new(async move {
- tracing::debug!("executing grid suspend");
- let view = view! { };
- Ok::<_, ServerFnError>(view)
- })
- }}
-
+ let grid = move || {
+ let wall = wall.get();
+ view! { }
};
let filter = move || {
@@ -295,7 +302,14 @@ fn WithWall(
let Some(problem_uid) = problem_uid.get() else {
return view! {}.into_any();
};
- view! { }
+ view! {
+
+ }
.into_any()
}}
@@ -309,39 +323,22 @@ fn WithUserInteraction(
#[prop(into)] wall_uid: Signal,
#[prop(into)] problem_uid: Signal,
#[prop(into)] user_interaction: Signal