mirror of https://github.com/logseq/logseq
improve(api): expose more values for user configures
parent
8125371c7a
commit
5815f37df1
|
@ -140,6 +140,8 @@ export interface AppUserConfigs {
|
||||||
|
|
||||||
currentGraph: string
|
currentGraph: string
|
||||||
showBracket: boolean
|
showBracket: boolean
|
||||||
|
enabledFlashcards: boolean
|
||||||
|
enabledJournals: boolean
|
||||||
|
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,9 +369,11 @@
|
||||||
(get (sub-config) (get-current-repo))))))
|
(get (sub-config) (get-current-repo))))))
|
||||||
|
|
||||||
(defn enable-journals?
|
(defn enable-journals?
|
||||||
[repo]
|
([]
|
||||||
(not (false? (:feature/enable-journals?
|
(enable-journals? (get-current-repo)))
|
||||||
(get (sub-config) repo)))))
|
([repo]
|
||||||
|
(not (false? (:feature/enable-journals?
|
||||||
|
(get (sub-config) repo))))))
|
||||||
|
|
||||||
(defn enable-flashcards?
|
(defn enable-flashcards?
|
||||||
([]
|
([]
|
||||||
|
|
|
@ -102,8 +102,16 @@
|
||||||
:preferred-start-of-week (state/get-start-of-week)
|
:preferred-start-of-week (state/get-start-of-week)
|
||||||
:current-graph (state/get-current-repo)
|
:current-graph (state/get-current-repo)
|
||||||
:show-brackets (state/show-brackets?)
|
:show-brackets (state/show-brackets?)
|
||||||
|
:enabled-journals (state/enable-journals?)
|
||||||
|
:enabled-flashcards (state/enable-flashcards?)
|
||||||
:me (state/get-me)}))))
|
:me (state/get-me)}))))
|
||||||
|
|
||||||
|
(def ^:export get_current_graph_configs
|
||||||
|
(fn []
|
||||||
|
(some-> (get (:config @state/state) (state/get-current-repo))
|
||||||
|
(normalize-keyword-for-json)
|
||||||
|
(bean/->js))))
|
||||||
|
|
||||||
(def ^:export get_current_graph
|
(def ^:export get_current_graph
|
||||||
(fn []
|
(fn []
|
||||||
(when-let [repo (state/get-current-repo)]
|
(when-let [repo (state/get-current-repo)]
|
||||||
|
|
Loading…
Reference in New Issue