فهرست منبع

refactor: use less util/node-test? where possible

also add new ns to kondo lint
Gabriel Horner 6 ماه پیش
والد
کامیت
762b83a3c9
3فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 1 0
      .clj-kondo/config.edn
  2. 1 1
      src/main/frontend/undo_redo.cljs
  3. 2 1
      src/test/frontend/undo_redo_test.cljs

+ 1 - 0
.clj-kondo/config.edn

@@ -157,6 +157,7 @@
              frontend.util.text text-util
              frontend.util.thingatpt thingatpt
              frontend.util.url url-util
+             frontend.worker.shared-service shared-service
              frontend.worker.handler.page worker-page
              frontend.worker.pipeline worker-pipeline
              frontend.worker.state worker-state

+ 1 - 1
src/main/frontend/undo_redo.cljs

@@ -327,7 +327,7 @@
   [repo {:keys [tx-data tx-meta db-after db-before]}]
   (let [{:keys [outliner-op]} tx-meta]
     (when (and
-           (or util/node-test? (= (:client-id tx-meta) (:client-id @state/state)))
+           (= (:client-id tx-meta) (:client-id @state/state))
            outliner-op
            (not (false? (:gen-undo-ops? tx-meta)))
            (not (:create-today-journal? tx-meta)))

+ 2 - 1
src/test/frontend/undo_redo_test.cljs

@@ -15,7 +15,8 @@
 
 (defmethod worker-db-listener/listen-db-changes :gen-undo-ops
   [_ {:keys [repo]} tx-report]
-  (undo-redo/gen-undo-ops! repo tx-report))
+  (undo-redo/gen-undo-ops! repo
+                           (assoc-in tx-report [:tx-meta :client-id] (:client-id @state/state))))
 
 (defn listen-db-fixture
   [f]