Browse Source

fix(sqlite): wrong db query

Andelf 2 years ago
parent
commit
eb4476c0b6

+ 1 - 1
deps/persist-db/src/index.js

@@ -203,7 +203,7 @@ const SQLiteDB = {
             await this.newDB(dbName);
             db = dbMap[dbName];
         }
-        const sql = sqlite3.str_new(db, "SELECT uuid, page_uuid FROM blocks");
+        const sql = sqlite3.str_new(db, "SELECT uuid, page_uuid FROM blocks WHERE type = 1");
         const prepared = await sqlite3.prepare_v2(db, sqlite3.str_value(sql));
         const rows = [];
         while (await sqlite3.step(prepared.stmt) === SQLite.SQLITE_ROW) {

File diff suppressed because it is too large
+ 0 - 0
resources/js/ls-wa-sqlite/persist-db-worker.js


File diff suppressed because it is too large
+ 0 - 0
resources/js/ls-wa-sqlite/persist-db-worker.js.map


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

@@ -141,12 +141,17 @@
           block? (boolean block-id)
           block (get-block page-name)
           block-unloaded? (state/sub-block-unloaded? repo (:block/uuid block))]
+      (prn ::page page-name block-id block? block page-e
+           (:block/_parent block))
       (cond
         block-unloaded?
         (ui/loading "Loading...")
 
-        (and (not block?)
-             (empty? (:block/_parent block)))
+        (and
+         (not block?)
+             (empty? (:block/_parent block))
+
+             )
         (dummy-block page-name)
 
         :else

+ 1 - 3
src/main/frontend/persist_db.cljs

@@ -41,6 +41,4 @@
   ([repo exclude-uuids]
    (<fetch-blocks-excluding repo exclude-uuids {}))
   ([repo exclude-uuids opts]
-   (p/let [ret (protocol/<fetch-blocks-excluding (get-impl) repo exclude-uuids opts)]
-     (js/console.log "fetch-by-exclude" ret)
-     ret)))
+   (protocol/<fetch-blocks-excluding (get-impl) repo exclude-uuids opts)))

Some files were not shown because too many files changed in this diff