fix: old file graphs showing up in app list of graphs

Both in sidebar but also in commands to select graphs
like 'Select graph to open'
This commit is contained in:
Gabriel Horner
2026-03-04 10:45:24 -05:00
committed by rcmerci
parent 703581d37b
commit 76776c53a8
2 changed files with 8 additions and 7 deletions

View File

@@ -8,10 +8,10 @@
[logseq.common.config :as common-config]
[promesa.core :as p]))
(defn local-file-based-graph?
(defn- local-file-based-graph?
[s]
(and (string? s)
(string/starts-with? s common-config/file-version-prefix)))
(string/starts-with? s (str common-config/db-version-prefix common-config/file-version-prefix))))
(defn get-all-graphs
[]
@@ -27,9 +27,9 @@
(distinct
(concat
repos'
(map (fn [repo-name]
{:name (common-config/canonicalize-db-version-repo repo-name)})
(some-> electron-disk-graphs bean/->clj))))))
(->> (some-> electron-disk-graphs bean/->clj)
(map (fn [repo-name]
{:name (common-config/canonicalize-db-version-repo repo-name)})))))))
(defn delete-graph!
[graph]

View File

@@ -12,7 +12,7 @@
(p/resolved [{:name "demo"}
{:name "logseq_db_prefixed"}
{:name "logseq_db_logseq_db_legacy"}
{:name "logseq_local_local-only"}]))
{:name "logseq_db_logseq_local_local-only"}]))
util/electron? (constantly true)
ipc/ipc (fn [_channel]
(p/resolved #js ["logseq_db_remote"
@@ -25,7 +25,8 @@
"logseq_db_remote"
"logseq_db_remote-legacy"}
(set names)))
(is (not-any? #(re-find #"^logseq_db_logseq_db_" %) names))))
(is (not-any? #(re-find #"^logseq_db_logseq_db_" %) names))
(is (not-any? #(re-find #"logseq_local_" %) names))))
(p/catch (fn [error]
(is false (str error))))
(p/finally done))))