diff --git a/libs/src/LSPlugin.ts b/libs/src/LSPlugin.ts index 26868b394..b38cf066f 100644 --- a/libs/src/LSPlugin.ts +++ b/libs/src/LSPlugin.ts @@ -140,6 +140,8 @@ export interface AppUserConfigs { currentGraph: string showBracket: boolean + enabledFlashcards: boolean + enabledJournals: boolean [key: string]: any } diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 3f5275750..d1d9e88e4 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -369,9 +369,11 @@ (get (sub-config) (get-current-repo)))))) (defn enable-journals? - [repo] - (not (false? (:feature/enable-journals? - (get (sub-config) repo))))) + ([] + (enable-journals? (get-current-repo))) + ([repo] + (not (false? (:feature/enable-journals? + (get (sub-config) repo)))))) (defn enable-flashcards? ([] diff --git a/src/main/logseq/api.cljs b/src/main/logseq/api.cljs index cbbd90740..997353cd9 100644 --- a/src/main/logseq/api.cljs +++ b/src/main/logseq/api.cljs @@ -102,8 +102,16 @@ :preferred-start-of-week (state/get-start-of-week) :current-graph (state/get-current-repo) :show-brackets (state/show-brackets?) + :enabled-journals (state/enable-journals?) + :enabled-flashcards (state/enable-flashcards?) :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 (fn [] (when-let [repo (state/get-current-repo)]