mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 15:15:01 +00:00
enhance(ux): show configure tag instead of create tag when exists
This commit is contained in:
@@ -84,11 +84,21 @@
|
||||
(when (and (not (string/blank? q))
|
||||
(not (#{"config.edn" "custom.js" "custom.css"} q))
|
||||
(not config/publishing?))
|
||||
(let [class? (string/starts-with? q "#")]
|
||||
(->> [{:text (if class? "Create tag" "Create page") :icon "new-page"
|
||||
(let [class? (string/starts-with? q "#")
|
||||
class-name (get-class-from-input q)
|
||||
class (ldb/class? (db/get-case-page class-name))]
|
||||
(->> [{:text (cond
|
||||
class "Configure tag"
|
||||
class? "Create tag"
|
||||
:else "Create page")
|
||||
:icon "new-page"
|
||||
:icon-theme :gray
|
||||
:info (if class?
|
||||
(str "Create class called '" (get-class-from-input q) "'")
|
||||
(let [class-name (get-class-from-input q)
|
||||
class (db/get-case-page class-name)]
|
||||
(if class
|
||||
(str "Configure #" class-name)
|
||||
(str "Create tag called '" class-name "'")))
|
||||
(str "Create page called '" q "'"))
|
||||
:source-create :page}]
|
||||
(remove nil?)))))
|
||||
|
||||
Reference in New Issue
Block a user