Tienson Qin il y a 2 ans
Parent
commit
03d6a84138

+ 1 - 0
.carve/ignore

@@ -48,6 +48,7 @@ frontend.mixins/perf-measure-mixin
 frontend.mobile.util/get-idevice-statusbar-height
 ;; Used in macro
 frontend.modules.outliner.datascript/transact!
+frontend.modules.outliner.core/*transaction-opts*
 ;; Referenced in comment
 frontend.page/route-view
 ;; placeholder fn

+ 2 - 12
src/main/frontend/handler/editor.cljs

@@ -233,13 +233,6 @@
     (doseq [block blocks]
       (gdom-classes/remove block "block-highlight"))))
 
-;; id: block dom id, "ls-block-counter-uuid"
-(defn- another-block-with-same-id-exists?
-  [current-id block-id]
-  (when-let [id (and (string? block-id) (parse-uuid block-id))]
-    (and (not= current-id id)
-         (db/entity [:block/uuid id]))))
-
 (defn- remove-non-existed-refs!
   [refs]
   (remove (fn [x] (or
@@ -383,11 +376,10 @@
   ([block value
     {:keys [force?]
      :as opts}]
-   (let [{:block/keys [uuid page format repo content properties]} block
+   (let [{:block/keys [page format repo content]} block
          repo (or repo (state/get-current-repo))
          format (or format (state/get-preferred-format))
          page (db/entity repo (:db/id page))
-         block-id (when (map? properties) (get properties :id))
          content (-> (property/remove-built-in-properties format content)
                      (drawer/remove-logbook))]
      (if force?
@@ -770,7 +762,6 @@
                      0)
                    0)
               f (fn []
-                  (prn {:pos pos})
                   (edit-block! (db/pull (:db/id block))
                                pos
                                id
@@ -2605,8 +2596,7 @@
   (state/set-edit-content! (state/get-edit-input-id) (.-value input)))
 
 (defn- delete-concat [current-block]
-  (let [input-id (state/get-edit-input-id)
-        ^js input (state/get-input)
+  (let [^js input (state/get-input)
         current-pos (cursor/pos input)
         value (gobj/get input "value")
         right (outliner-core/get-right-sibling (:db/id current-block))

+ 1 - 1
src/main/frontend/modules/outliner/core.cljs

@@ -863,7 +863,7 @@
   see also `frontend.modules.outliner.transaction/transact!`"
   nil)
 
-(def ^:private ^:dynamic *transaction-opts*
+(def ^:private ^:dynamic #_:clj-kondo/ignore *transaction-opts*
   "Stores transaction opts that are generated by one or more write-operations,
   see also `frontend.modules.outliner.transaction/transact!`"
   nil)

+ 2 - 2
src/main/frontend/modules/outliner/datascript.cljc

@@ -133,8 +133,8 @@
                   (not (contains? (:file/unlinked-dirs @state/state)
                                   (config/get-repo-dir (state/get-current-repo)))))
 
-         (prn "[DEBUG] Outliner transact:")
-         (frontend.util/pprint {:txs txs :opts opts})
+         ;; (prn "[DEBUG] Outliner transact:")
+         ;; (frontend.util/pprint {:txs txs :opts opts})
 
          (try
            (let [repo (get opts :repo (state/get-current-repo))