fix: lint

pull/9404/head
Tienson Qin 2023-05-15 21:53:18 +08:00
parent 0df201e7a8
commit 03d6a84138
4 changed files with 6 additions and 15 deletions

View File

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

View File

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

View File

@ -863,7 +863,7 @@
see also `frontend.modules.outliner.transaction/transact!`" see also `frontend.modules.outliner.transaction/transact!`"
nil) 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, "Stores transaction opts that are generated by one or more write-operations,
see also `frontend.modules.outliner.transaction/transact!`" see also `frontend.modules.outliner.transaction/transact!`"
nil) nil)

View File

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