diff --git a/CHANGES.md b/CHANGES.md index f5f694f22..98d28c6ab 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ - Fix minor inconsistencies on RPC `get-file-libraries` and `get-file` methods (add missing team-id prop) - Fix problem with viewer role and inspect mode [Taiga #9751](https://tree.taiga.io/project/penpot/issue/9751) +- Fix error when clicking on a comment at the viewer's sidebar [Taiga #10465](https://tree.taiga.io/project/penpot/issue/10465) ## 2.5.3 diff --git a/frontend/src/app/main/ui/workspace/comments.cljs b/frontend/src/app/main/ui/workspace/comments.cljs index 376a91eee..b828746a1 100644 --- a/frontend/src/app/main/ui/workspace/comments.cljs +++ b/frontend/src/app/main/ui/workspace/comments.cljs @@ -8,6 +8,7 @@ (:require-macros [app.main.style :as stl]) (:require [app.main.data.comments :as dcmt] + [app.main.data.event :as ev] [app.main.data.workspace :as dw] [app.main.data.workspace.comments :as dwcm] [app.main.refs :as refs] @@ -112,9 +113,11 @@ on-thread-click (mf/use-fn - (mf/deps page-id) + (mf/deps page-id from-viewer) (fn [thread] - (st/emit! (dwcm/navigate-to-comment thread))))] + (if from-viewer + (st/emit! (with-meta (dcmt/open-thread thread) {::ev/origin "viewer"})) + (st/emit! (dwcm/navigate-to-comment thread)))))] [:div {:class (stl/css-case :comments-section true :from-viewer from-viewer)}