Merge remote-tracking branch 'upstream/master' into whiteboards

This commit is contained in:
Peng Xiao
2022-08-03 14:12:10 +08:00
24 changed files with 852 additions and 768 deletions

View File

@@ -60,6 +60,8 @@
:modal/close-btn? nil
:modal/subsets []
;; left sidebar
:ui/navigation-item-collapsed? {}
;; right sidebar
:ui/fullscreen? false
@@ -296,17 +298,22 @@
(when-not (mobile-util/native-platform?)
"local")))
(def default-config
"Default config for a repo-specific, user config"
{:feature/enable-search-remove-accents? true
:default-arweave-gateway "https://arweave.net"})
(defn get-config
"User config for the given repo or current repo if none given"
([]
(get-config (get-current-repo)))
([repo-url]
(get-in @state [:config repo-url])))
(def default-arweave-gateway "https://arweave.net")
(merge default-config
(get-in @state [:config repo-url]))))
(defn get-arweave-gateway
[]
(:arweave/gateway (get-config) default-arweave-gateway))
(:arweave/gateway (get-config)))
(defonce built-in-macros
{"img" "[:img.$4 {:src \"$1\" :style {:width $2 :height $3}}]"})
@@ -755,6 +762,10 @@
:custom-context-menu/show? false
:custom-context-menu/links nil))
(defn toggle-navigation-item-collapsed!
[item]
(update-state! [:ui/navigation-item-collapsed? item] not))
(defn toggle-sidebar-open?!
[]
(swap! state update :ui/sidebar-open? not))
@@ -1715,3 +1726,7 @@
(defn unlinked-dir?
[dir]
(contains? (:file/unlinked-dirs @state) dir))
(defn enable-search-remove-accents?
[]
(:feature/enable-search-remove-accents? (get-config)))