From 4d2d5593835c96bf9b3c5499334a93c1e7221f75 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 15 Apr 2026 15:57:12 +0200 Subject: [PATCH] :bug: Fix problem with finish render callback --- frontend/src/app/render_wasm/api.cljs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index da5ce35e72..c23a872334 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -1120,11 +1120,13 @@ (if (or (seq pending-thumbnails) (seq pending-full)) (->> (rx/concat (->> (rx/from (vals pending-thumbnails)) - (rx/merge-map (fn [callback] (callback))) - (rx/reduce conj [])) + (rx/merge-map (fn [callback] (if (fn? callback) (callback) (rx/empty)))) + (rx/reduce conj []) + (rx/catch #(rx/empty))) (->> (rx/from (vals pending-full)) - (rx/mapcat (fn [callback] (callback))) - (rx/reduce conj []))) + (rx/mapcat (fn [callback] (if (fn? callback) (callback) (rx/empty)))) + (rx/reduce conj []) + (rx/catch #(rx/empty)))) (rx/subs! (fn [_] ;; Fonts are now loaded — recompute text layouts so Skia @@ -1134,7 +1136,7 @@ (update-text-layouts text-ids))) (request-render "images-loaded")) noop-fn - (fn [] (when on-complete (on-complete))))) + (fn [] (when (fn? on-complete) (on-complete))))) ;; No pending images — complete immediately. (when on-complete (on-complete)))))