From 198339f23219c5010bf0dfbc0115e480679c57a5 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 22 Nov 2024 10:25:54 +0100 Subject: [PATCH] :bug: Fix change page with wasm render --- frontend/src/app/main/ui/workspace/viewport_wasm.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/viewport_wasm.cljs b/frontend/src/app/main/ui/workspace/viewport_wasm.cljs index 4150fc7da..d5deb50c1 100644 --- a/frontend/src/app/main/ui/workspace/viewport_wasm.cljs +++ b/frontend/src/app/main/ui/workspace/viewport_wasm.cljs @@ -275,7 +275,11 @@ preview-blend (-> refs/workspace-preview-blend (mf/deref))] - (mf/with-effect [] + ;; NOTE: We need this page-id dependency to react to it and reset the + ;; canvas, even though we are not using `page-id` inside the hook. + ;; We think moving this out to a handler will make the render code + ;; harder to follow through. + (mf/with-effect [page-id] (when-let [canvas (mf/ref-val canvas-ref)] (->> wasm.api/module (p/fmap (fn [ready?]