mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
feat(mobile): add priority toggle button to toolbar
This commit is contained in:
@@ -3,6 +3,20 @@
|
||||
[frontend.util :as util]
|
||||
[frontend.util.marker :as marker]))
|
||||
|
||||
(defn cycle-priority-state
|
||||
[content]
|
||||
(let [priority-reg #"\[#(ABC){1}\]\s{1}"
|
||||
priority (last (util/safe-re-find priority-reg content))
|
||||
next-priority (case priority
|
||||
"A" "B"
|
||||
|
||||
"B" "C"
|
||||
|
||||
"C" nil
|
||||
|
||||
"A")]
|
||||
(and next-priority (util/format "[#%s]" next-priority))))
|
||||
|
||||
(defn add-or-update-priority
|
||||
[content format priority]
|
||||
(let [priority-pattern #"(\[#[ABC]\])?\s?"
|
||||
|
||||
Reference in New Issue
Block a user