From 619b557c80e90109cec4ddbd11f85a01c95490c5 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 15 Feb 2024 16:39:09 +0100 Subject: [PATCH] :bug: Fix anonymous access to shared prototypes --- backend/src/app/rpc/commands/files.clj | 1 + frontend/src/app/main/data/viewer.cljs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 3f7313291..38aba8f30 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -351,6 +351,7 @@ (sv/defmethod ::get-file-fragment "Retrieve a file fragment by its ID. Only authenticated users." {::doc/added "1.17" + ::rpc/auth false ::sm/params schema:get-file-fragment ::sm/result schema:file-fragment} [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id fragment-id share-id]}] diff --git a/frontend/src/app/main/data/viewer.cljs b/frontend/src/app/main/data/viewer.cljs index af8401d8a..a698e567c 100644 --- a/frontend/src/app/main/data/viewer.cljs +++ b/frontend/src/app/main/data/viewer.cljs @@ -74,9 +74,11 @@ (assoc-in [:viewer-local :interactions-show?] interactions-show?))) ptk/WatchEvent - (watch [_ _ _] + (watch [_ state _] (rx/of (fetch-bundle (d/without-nils params)) - (fetch-comment-threads params))) + ;; Only fetch threads for logged-in users + (when (some? (:profile state)) + (fetch-comment-threads params)))) ptk/EffectEvent (effect [_ _ _]