Просмотр исходного кода

fix: click can't create block reference

Resolved #1337
Tienson Qin 5 лет назад
Родитель
Сommit
b9fd0ef7ab
2 измененных файлов с 3 добавлено и 5 удалено
  1. 2 4
      src/main/frontend/components/editor.cljs
  2. 1 1
      src/main/frontend/handler/editor.cljs

+ 2 - 4
src/main/frontend/components/editor.cljs

@@ -150,10 +150,8 @@
              @editor-handler/*selected-text
              (when (> (count edit-content) current-pos)
                (subs edit-content pos current-pos)))
-          _ (p/let [matched-blocks (when-not (string/blank? q)
-                                     (editor-handler/get-matched-blocks q (:block/uuid edit-block)))]
-              (state/set-search-result! matched-blocks))
-          matched-blocks (state/sub :search/result)]
+          matched-blocks (when-not (string/blank? q)
+                           (editor-handler/get-matched-blocks q (:block/uuid edit-block)))]
       (when input
         (let [chosen-handler (fn [chosen _click?]
                                (state/set-editor-show-block-search! false)

+ 1 - 1
src/main/frontend/handler/editor.cljs

@@ -1776,7 +1776,7 @@
                                                       99)
                                 (map (comp str :block/uuid))))
         current-and-parents (set/union #{(str (:block/uuid current-block))} block-parents)]
-    (p/let [result (search/block-search q 10)]
+    (let [result (search/block-search q 10)]
       (remove
        (fn [h]
          (contains? current-and-parents (:block/uuid h)))