mirror of
https://github.com/logseq/logseq.git
synced 2026-05-23 20:24:15 +00:00
fix: delete untitled pages
This commit is contained in:
@@ -2451,6 +2451,9 @@
|
||||
db (db/get-db)
|
||||
query? (ldb/class-instance? (entity-plus/entity-memoized db :logseq.class/Query) block')]
|
||||
(cond
|
||||
(and (:page-title? config) (ldb/page? block) (string/blank? (:block/title block)))
|
||||
[:div.opacity-75 "Untitled"]
|
||||
|
||||
(:raw-title? config)
|
||||
(text-block-title (dissoc config :raw-title?) block)
|
||||
|
||||
|
||||
@@ -26,5 +26,6 @@
|
||||
(filter db/page?)
|
||||
(remove ldb/hidden?)
|
||||
(remove (fn [e]
|
||||
(and (ldb/property? e)
|
||||
(true? (:logseq.property/hide? e)))))))
|
||||
(or (and (ldb/property? e)
|
||||
(true? (:logseq.property/hide? e)))
|
||||
(string/blank? (:block/title e)))))))
|
||||
|
||||
@@ -1057,7 +1057,7 @@
|
||||
lookup-refs (map (fn [id] [:block/uuid id]) block-uuids)
|
||||
blocks (map db/entity lookup-refs)
|
||||
pages (filter ldb/page? blocks)
|
||||
pages-with-parent (filter :block/parent pages)]
|
||||
pages-with-parent (filter (fn [page] (and (:block/parent page) (not (string/blank? (:block/title page))))) pages)]
|
||||
(ui-outliner-tx/transact!
|
||||
{:outliner-op :delete-blocks}
|
||||
(doseq [page pages-with-parent]
|
||||
|
||||
Reference in New Issue
Block a user