From ee4e1fbbf4e79ad2723dff227200de5318293a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Tue, 2 Apr 2024 14:59:19 +0200 Subject: [PATCH] :bug: Fix comments not being visible on view mode --- frontend/src/app/main/ui/comments.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index 200427a1d..31cfd9a60 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -360,7 +360,8 @@ (l/derived (l/in [:comments thread-id]) st/state)) (defn- offset-position [position viewport zoom bubble-margin] - (let [base-x (+ (* (:x position) zoom) (:offset-x viewport)) + (let [viewport (or viewport {:offset-x 0 :offset-y 0 :width 0 :height 0}) + base-x (+ (* (:x position) zoom) (:offset-x viewport)) base-y (+ (* (:y position) zoom) (:offset-y viewport)) w (:width viewport) h (:height viewport) @@ -385,7 +386,7 @@ (some? position-modifier) (gpt/transform position-modifier)) - max-height (int (* (:height viewport) 0.75)) + max-height (when (some? viewport) (int (* (:height viewport) 0.75))) ;; We should probably look for a better way of doing this. bubble-margin {:x 24 :y 0} pos (offset-position base-pos viewport zoom bubble-margin)