From 8a33a63f9115279af16fb9fab523ac36901c024b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 24 Aug 2022 12:08:38 +0200 Subject: [PATCH 1/2] :bug: Fix permissions when moving comments --- backend/src/app/rpc/commands/comments.clj | 6 ++++-- frontend/src/app/main/ui/workspace.cljs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/comments.clj b/backend/src/app/rpc/commands/comments.clj index 576f6599c..0e4ce7ff6 100644 --- a/backend/src/app/rpc/commands/comments.clj +++ b/backend/src/app/rpc/commands/comments.clj @@ -496,7 +496,8 @@ ;; --- COMMAND: Update comment thread position (s/def ::update-comment-thread-position - (s/keys :req-un [::profile-id ::id ::position ::frame-id ::share-id])) + (s/keys :req-un [::profile-id ::id ::position ::frame-id] + :opt-un [::share-id])) (sv/defmethod ::update-comment-thread-position {::doc/added "1.15"} @@ -514,7 +515,8 @@ ;; --- COMMAND: Update comment frame (s/def ::update-comment-thread-frame - (s/keys :req-un [::profile-id ::id ::frame-id ::share-id])) + (s/keys :req-un [::profile-id ::id ::frame-id] + :opt-un [::share-id])) (sv/defmethod ::update-comment-thread-frame {::doc/added "1.15"} diff --git a/frontend/src/app/main/ui/workspace.cljs b/frontend/src/app/main/ui/workspace.cljs index 17b1fce61..808ee67f0 100644 --- a/frontend/src/app/main/ui/workspace.cljs +++ b/frontend/src/app/main/ui/workspace.cljs @@ -8,6 +8,7 @@ (:require [app.common.colors :as clr] [app.common.data.macros :as dm] + [app.main.data.comments :as dcm] [app.main.data.messages :as msg] [app.main.data.workspace :as dw] [app.main.data.workspace.persistence :as dwp] @@ -127,6 +128,7 @@ (mf/with-effect [project-id file-id] (st/emit! (dw/initialize-file project-id file-id)) + (st/emit! (dcm/retrieve-comment-threads file-id)) (fn [] (st/emit! ::dwp/force-persist (dw/finalize-file project-id file-id)))) From 44330ffb3bea1149351273bacd7e8f7c4576e60f Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 24 Aug 2022 12:16:54 +0200 Subject: [PATCH 2/2] :bug: Fix permissions when moving comments --- frontend/src/app/main/data/workspace.cljs | 4 +++- frontend/src/app/main/ui/workspace.cljs | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index c333f8874..b31a77e6d 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -22,6 +22,7 @@ [app.common.types.shape :as cts] [app.common.uuid :as uuid] [app.config :as cfg] + [app.main.data.comments :as dcm] [app.main.data.events :as ev] [app.main.data.messages :as msg] [app.main.data.users :as du] @@ -113,7 +114,8 @@ ptk/WatchEvent (watch [_ _ stream] (rx/merge - (rx/of (dwp/fetch-bundle project-id file-id)) + (rx/of (dwp/fetch-bundle project-id file-id) + (dcm/retrieve-comment-threads file-id)) ;; Initialize notifications (websocket connection) and the file persistence (->> stream diff --git a/frontend/src/app/main/ui/workspace.cljs b/frontend/src/app/main/ui/workspace.cljs index 808ee67f0..17b1fce61 100644 --- a/frontend/src/app/main/ui/workspace.cljs +++ b/frontend/src/app/main/ui/workspace.cljs @@ -8,7 +8,6 @@ (:require [app.common.colors :as clr] [app.common.data.macros :as dm] - [app.main.data.comments :as dcm] [app.main.data.messages :as msg] [app.main.data.workspace :as dw] [app.main.data.workspace.persistence :as dwp] @@ -128,7 +127,6 @@ (mf/with-effect [project-id file-id] (st/emit! (dw/initialize-file project-id file-id)) - (st/emit! (dcm/retrieve-comment-threads file-id)) (fn [] (st/emit! ::dwp/force-persist (dw/finalize-file project-id file-id))))