From 151421c8db66a1cafd866db1a7011d39e59fa262 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Tue, 19 Mar 2024 13:39:48 +0100 Subject: [PATCH] :bug: Fix toggle comments and history states --- frontend/src/app/main/data/workspace/layout.cljs | 1 - frontend/src/app/main/ui/workspace/right_header.cljs | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace/layout.cljs b/frontend/src/app/main/data/workspace/layout.cljs index 1c7582a59..157de23f7 100644 --- a/frontend/src/app/main/data/workspace/layout.cljs +++ b/frontend/src/app/main/data/workspace/layout.cljs @@ -89,7 +89,6 @@ (update [_ state] (update state :workspace-layout (fn [flags] - (prn flags) (if force? (conj flags flag) (if (contains? flags flag) diff --git a/frontend/src/app/main/ui/workspace/right_header.cljs b/frontend/src/app/main/ui/workspace/right_header.cljs index 1fae7d76c..f2e1b53f0 100644 --- a/frontend/src/app/main/ui/workspace/right_header.cljs +++ b/frontend/src/app/main/ui/workspace/right_header.cljs @@ -179,6 +179,10 @@ (mf/use-fn (mf/deps selected-drawtool) (fn [_] + (when (contains? layout :document-history) + (st/emit! (-> (dw/remove-layout-flag :document-history) + (vary-meta assoc ::ev/origin "workspace-header")))) + (if (= :comments selected-drawtool) (st/emit! :interrupt) (active-comments)))) @@ -187,8 +191,11 @@ (mf/use-fn (mf/deps selected-drawtool) (fn [] + (when (= :comments selected-drawtool) - (st/emit! :interrupt)) + (st/emit! :interrupt + (-> (dw/toggle-layout-flag :comments) + (vary-meta assoc ::ev/origin "workspace-header")))) (st/emit! (-> (dw/toggle-layout-flag :document-history) (vary-meta assoc ::ev/origin "workspace-header")))))]