mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
enhance: pub-event! returns a promise (#9671)
enhance: pub-event! returns a promise fix: typing 1. sometimes can result in 1. 1.
This commit is contained in:
@@ -1873,10 +1873,9 @@
|
||||
(cond
|
||||
(and (= content "1. ") (= last-input-char " ") input-id edit-block
|
||||
(not (own-order-number-list? edit-block)))
|
||||
(do
|
||||
(state/set-edit-content! input-id "")
|
||||
(-> (p/delay 10)
|
||||
(p/then #(state/pub-event! [:editor/toggle-own-number-list edit-block]))))
|
||||
(p/do!
|
||||
(state/pub-event! [:editor/toggle-own-number-list edit-block])
|
||||
(state/set-edit-content! input-id ""))
|
||||
|
||||
(and (= last-input-char commands/command-trigger)
|
||||
(or (re-find #"(?m)^/" (str (.-value input))) (start-of-new-word? input pos)))
|
||||
|
||||
Reference in New Issue
Block a user