From a4776cf27fcce34eb89ab59261d01347d35fe84b Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 2 Apr 2024 11:15:11 +0200 Subject: [PATCH] :bug: Fix problem with comment refreshing --- frontend/src/app/main/data/comments.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/comments.cljs b/frontend/src/app/main/data/comments.cljs index 807db96e8..0a441068f 100644 --- a/frontend/src/app/main/data/comments.cljs +++ b/frontend/src/app/main/data/comments.cljs @@ -249,14 +249,16 @@ ptk/UpdateEvent (update [_ state] - (d/update-in-when state [:comments thread-id id] assoc :content content)) + (-> state + (d/update-in-when [:comments thread-id id] assoc :content content))) ptk/WatchEvent (watch [_ state _] - (let [share-id (-> state :viewer-local :share-id)] + (let [file-id (:current-file-id state) + share-id (-> state :viewer-local :share-id)] (->> (rp/cmd! :update-comment {:id id :content content :share-id share-id}) (rx/catch #(rx/throw {:type :comment-error})) - (rx/ignore)))))) + (rx/map #(retrieve-comment-threads file-id))))))) (defn delete-comment-thread-on-workspace [{:keys [id] :as thread}]