Explorar el Código

fix: content disappeared from Tag notes

Tienson Qin hace 1 año
padre
commit
8c0293de57
Se han modificado 2 ficheros con 6 adiciones y 10 borrados
  1. 2 7
      src/main/frontend/components/page.cljs
  2. 4 3
      src/main/frontend/db/async.cljs

+ 2 - 7
src/main/frontend/components/page.cljs

@@ -220,8 +220,6 @@
 
 
                      :else
                      :else
                      children)
                      children)
-          *loading? (:*loading? config)
-          loading? (when *loading? (rum/react *loading?))
           db-based? (config/db-based-graph? repo)]
           db-based? (config/db-based-graph? repo)]
       [:<>
       [:<>
        (when (and db-based? (or (ldb/class? block) (ldb/property? block)))
        (when (and db-based? (or (ldb/class? block) (ldb/property? block)))
@@ -230,11 +228,7 @@
 
 
        [:div.ml-1
        [:div.ml-1
         (cond
         (cond
-          loading?
-          nil
-
           (and
           (and
-           (not loading?)
            (not block?)
            (not block?)
            (empty? children) page-e)
            (empty? children) page-e)
           (dummy-block page-e)
           (dummy-block page-e)
@@ -668,7 +662,8 @@
                     ::page-name page-name'
                     ::page-name page-name'
                     ::loading? *loading?)))}
                     ::loading? *loading?)))}
   [state option]
   [state option]
-  (page-inner (assoc option :*loading? (::loading? state))))
+  (when-not (rum/react (::loading? state))
+    (page-inner option)))
 
 
 (rum/defcs page-cp
 (rum/defcs page-cp
   [state option]
   [state option]

+ 4 - 3
src/main/frontend/db/async.cljs

@@ -117,10 +117,11 @@
 (defn <get-block
 (defn <get-block
   [graph name-or-uuid & {:keys [children? nested-children?]
   [graph name-or-uuid & {:keys [children? nested-children?]
                          :or {children? true
                          :or {children? true
-                              nested-children? false}}]
+                              nested-children? false}
+                         :as opts}]
   (let [name' (str name-or-uuid)
   (let [name' (str name-or-uuid)
         *async-queries (:db/async-queries @state/state)
         *async-queries (:db/async-queries @state/state)
-        async-requested? (get @*async-queries name')
+        async-requested? (get @*async-queries [name' opts])
         e (cond
         e (cond
             (number? name-or-uuid)
             (number? name-or-uuid)
             (db/entity name-or-uuid)
             (db/entity name-or-uuid)
@@ -134,7 +135,7 @@
     (if (or (:block.temp/fully-loaded? e) async-requested?)
     (if (or (:block.temp/fully-loaded? e) async-requested?)
       e
       e
       (when-let [^Object sqlite @db-browser/*worker]
       (when-let [^Object sqlite @db-browser/*worker]
-        (swap! *async-queries assoc name' true)
+        (swap! *async-queries assoc [name' opts] true)
         (state/update-state! :db/async-query-loading (fn [s] (conj s name')))
         (state/update-state! :db/async-query-loading (fn [s] (conj s name')))
         (p/let [result (.get-block-and-children sqlite graph id (ldb/write-transit-str
         (p/let [result (.get-block-and-children sqlite graph id (ldb/write-transit-str
                                                                  {:children? children?
                                                                  {:children? children?