mirror of https://github.com/logseq/logseq
fix: undo text still shows up in search results
fixes https://github.com/logseq/db-test/issues/26pull/11483/head^2
parent
69816cdd2b
commit
009ba0b654
|
@ -9,7 +9,8 @@
|
||||||
[frontend.common.search-fuzzy :as fuzzy]
|
[frontend.common.search-fuzzy :as fuzzy]
|
||||||
[logseq.db.sqlite.util :as sqlite-util]
|
[logseq.db.sqlite.util :as sqlite-util]
|
||||||
[logseq.common.util :as common-util]
|
[logseq.common.util :as common-util]
|
||||||
[logseq.db :as ldb]))
|
[logseq.db :as ldb]
|
||||||
|
[clojure.set :as set]))
|
||||||
|
|
||||||
;; TODO: use sqlite for fuzzy search
|
;; TODO: use sqlite for fuzzy search
|
||||||
;; maybe https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md?
|
;; maybe https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md?
|
||||||
|
@ -412,7 +413,12 @@ DROP TRIGGER IF EXISTS blocks_au;
|
||||||
|
|
||||||
;; update block indice
|
;; update block indice
|
||||||
(when (or (seq blocks-to-add) (seq blocks-to-remove))
|
(when (or (seq blocks-to-add) (seq blocks-to-remove))
|
||||||
(let [blocks-to-add (keep block->index blocks-to-add)
|
(let [blocks-to-add' (keep block->index blocks-to-add)
|
||||||
blocks-to-remove (set (map (comp str :block/uuid) blocks-to-remove))]
|
blocks-to-remove (set (concat (map (comp str :block/uuid) blocks-to-remove)
|
||||||
|
(->>
|
||||||
|
(set/difference
|
||||||
|
(set (map :block/uuid blocks-to-add))
|
||||||
|
(set (map :block/uuid blocks-to-add')))
|
||||||
|
(map str))))]
|
||||||
{:blocks-to-remove-set blocks-to-remove
|
{:blocks-to-remove-set blocks-to-remove
|
||||||
:blocks-to-add blocks-to-add}))))
|
:blocks-to-add blocks-to-add'}))))
|
||||||
|
|
Loading…
Reference in New Issue