mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: slash command menu won't update to the setting language
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
(defonce command-ask "\\")
|
||||
(defonce *current-command (atom nil))
|
||||
|
||||
(def query-doc
|
||||
(defn query-doc
|
||||
[]
|
||||
[:div {:on-pointer-down (fn [e] (.stopPropagation e))}
|
||||
[:div.font-medium.text-lg.mb-2 (t :query/examples-title)]
|
||||
[:ul.mb-1
|
||||
@@ -41,7 +42,6 @@
|
||||
[:li.mb-1 [:code "{{query (and (between -7d +7d) (task Done))}}"]]
|
||||
[:li.mb-1 [:code "{{query (property key value)}}"]]
|
||||
[:li.mb-1 [:code "{{query (tags #tag)}}"]]]
|
||||
|
||||
[:p
|
||||
(interpolate-sentence
|
||||
(t :query/examples-desc)
|
||||
@@ -293,7 +293,7 @@
|
||||
:icon/numberedChildren]]
|
||||
|
||||
;; advanced
|
||||
[[(t :property.built-in/query) (query-steps) query-doc :icon/query (t :editor.slash/group-advanced)]
|
||||
[[(t :property.built-in/query) (query-steps) (query-doc) :icon/query (t :editor.slash/group-advanced)]
|
||||
[(t :editor.slash/advanced-query) (advanced-query-steps) (t :editor.slash/advanced-query-desc) :icon/query]
|
||||
[(t :editor.slash/query-function) [[:editor/input "{{function }}" {:backward-pos 2}]] (t :editor.slash/query-function-desc) :icon/queryCode]
|
||||
[(t :editor.slash/calculator)
|
||||
|
||||
@@ -40,11 +40,14 @@
|
||||
(defn filter-commands
|
||||
[page? commands]
|
||||
(if page?
|
||||
(filter (fn [item]
|
||||
(or
|
||||
(= "Add new property" (first item))
|
||||
(when (= (count item) 5)
|
||||
(contains? #{"TASK STATUS" "TASK DATE" "PRIORITY"} (last item))))) commands)
|
||||
(let [task-groups #{(t :editor.slash/group-task-status)
|
||||
(t :editor.slash/group-task-date)
|
||||
(t :editor.slash/group-priority)}]
|
||||
(filter (fn [item]
|
||||
(or
|
||||
(= (t :command.editor/add-property) (first item))
|
||||
(when (= (count item) 5)
|
||||
(contains? task-groups (last item))))) commands))
|
||||
commands))
|
||||
|
||||
(defn node-render
|
||||
|
||||
@@ -314,6 +314,7 @@
|
||||
(let [on-change (fn [e]
|
||||
(let [lang-code (util/evalue e)]
|
||||
(state/set-preferred-language! lang-code)
|
||||
(state/pub-event! [:init/commands])
|
||||
(ui-handler/re-render-root!)))
|
||||
action [:select.form-select.is-small {:value preferred-language
|
||||
:on-change on-change}
|
||||
|
||||
Reference in New Issue
Block a user