From 1384ed8aba1f5c44da1793795f6ed17ef151ca5d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 25 Aug 2025 10:21:31 +0200 Subject: [PATCH] :zap: Remove duplicated execution of check-open-transactions --- frontend/src/app/main/data/workspace/undo.cljs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/undo.cljs b/frontend/src/app/main/data/workspace/undo.cljs index 16e37114e4..728c4f4201 100644 --- a/frontend/src/app/main/data/workspace/undo.cljs +++ b/frontend/src/app/main/data/workspace/undo.cljs @@ -170,12 +170,13 @@ (update :transactions-pending assoc id (ct/now)))))) ptk/WatchEvent - (watch [_ _ _] + (watch [_ _ stream] (when (and timeout (pos? timeout)) - (->> (rx/of (check-open-transactions timeout)) - ;; Wait the configured time - (rx/delay timeout)))))) - + (let [stoper (rx/filter (ptk/type? ::start-undo-transaction) stream)] + (->> (rx/of (check-open-transactions timeout)) + ;; Wait the configured time + (rx/delay timeout) + (rx/take-until stoper))))))) (defn discard-undo-transaction "Updates the state to discard any current and pending undo transaction."