1
0
Эх сурвалжийг харах

fix: block wrong indentation in queries

Tienson Qin 3 жил өмнө
parent
commit
9042aa47c5

+ 13 - 14
src/main/frontend/db/react.cljs

@@ -316,20 +316,19 @@
                  (or (get affected-keys (vec (rest k)))
                      custom?
                      kv?))
-            (util/profile (str "refresh! " (second k))
-             (let [{:keys [query query-fn]} cache]
-               (when (or query query-fn)
-                 (try
-                   (let [f #(execute-query! repo-url db k tx cache)]
-                     ;; Detects whether user is editing in a custom query, if so, execute the query immediately
-                     (if (and custom?
-                              ;; modifying during cards review need to be executed immediately
-                              (not (:cards-query? (meta query)))
-                              (not (state/edit-in-query-component)))
-                       (async/put! (state/get-reactive-custom-queries-chan) [f query])
-                       (f)))
-                   (catch js/Error e
-                     (js/console.error e))))))))))))
+            (let [{:keys [query query-fn]} cache]
+              (when (or query query-fn)
+                (try
+                  (let [f #(execute-query! repo-url db k tx cache)]
+                    ;; Detects whether user is editing in a custom query, if so, execute the query immediately
+                    (if (and custom?
+                             ;; modifying during cards review need to be executed immediately
+                             (not (:cards-query? (meta query)))
+                             (not (state/edit-in-query-component)))
+                      (async/put! (state/get-reactive-custom-queries-chan) [f query])
+                      (f)))
+                  (catch js/Error e
+                    (js/console.error e)))))))))))
 
 (defn set-key-value
   [repo-url key value]

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

@@ -453,9 +453,9 @@
 (declare save-current-block!)
 (defn outliner-insert-block!
   [config current-block new-block {:keys [sibling? keep-uuid? replace-empty-target?]}]
-  (let [ref-query-top-block? (and (:ref? config)
-                            (:custom-query? config)
-                            (not (:ref-or-query? config)))
+  (let [ref-query-top-block? (and (or (:ref? config)
+                                      (:custom-query? config))
+                                  (not (:ref-query-child? config)))
         has-children? (db/has-children? (:block/uuid current-block))
         sibling? (cond
                    ref-query-top-block?