mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: user custom commands not working
This commit is contained in:
@@ -132,7 +132,7 @@
|
||||
;; ["Upload a file" nil]
|
||||
]
|
||||
;; Allow user to modify or extend, should specify how to extend.
|
||||
(get-in @state/state [:config (state/get-current-repo) :commands]))
|
||||
(state/get-commands))
|
||||
(remove nil?)
|
||||
(util/distinct-by-last-wins first)))
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
["Comment" (->block "comment")]]
|
||||
|
||||
;; Allow user to modify or extend, should specify how to extend.
|
||||
(get-in @state/state [:config (state/get-current-repo) :block-commands]))
|
||||
(state/get-commands))
|
||||
(remove nil?)
|
||||
(util/distinct-by-last-wins first)))
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
(not (seq (db/get-files config/local-repo))))
|
||||
(repo-handler/setup-local-repo-if-not-exists!)
|
||||
(state/set-db-restoring! false))
|
||||
(page-handler/init-commands!)
|
||||
(if (seq (:repos me))
|
||||
;; FIXME: handle error
|
||||
(repo-handler/request-app-tokens!
|
||||
@@ -131,8 +132,6 @@
|
||||
(notification/show! "Sorry, it seems that your browser doesn't support IndexedDB, we recommend to use latest Chrome(Chromium) or Firefox(Non-private mode)." :error false)
|
||||
(state/set-indexedb-support! false)))
|
||||
|
||||
(page-handler/init-commands!)
|
||||
|
||||
(restore-and-setup! me repos logged?)
|
||||
|
||||
(periodically-persist-repo-to-indexeddb!)
|
||||
|
||||
@@ -1361,10 +1361,6 @@
|
||||
:or {restore? true}
|
||||
:as option}]
|
||||
(cond
|
||||
(fn? command-output)
|
||||
(let [s (command-output)]
|
||||
(commands/insert! id s option))
|
||||
|
||||
;; replace string
|
||||
(string? command-output)
|
||||
(commands/insert! id command-output option)
|
||||
@@ -1373,6 +1369,10 @@
|
||||
(vector? command-output)
|
||||
(commands/handle-steps command-output format)
|
||||
|
||||
(fn? command-output)
|
||||
(let [s (command-output)]
|
||||
(commands/insert! id s option))
|
||||
|
||||
:else
|
||||
nil)
|
||||
|
||||
|
||||
@@ -863,6 +863,10 @@
|
||||
[]
|
||||
(:network/online? @state))
|
||||
|
||||
(defn get-commands
|
||||
[]
|
||||
(:commands (get-config)))
|
||||
|
||||
(defonce editor-op (atom nil))
|
||||
(defn set-editor-op!
|
||||
[value]
|
||||
|
||||
Reference in New Issue
Block a user