This commit is contained in:
Florian Schroedl 2024-08-13 16:18:24 +02:00
parent 2f2ed0a42f
commit 9aadb8c72f
2 changed files with 67 additions and 25 deletions

View file

@ -93,9 +93,15 @@
(defn add-token-to-token-set [token token-set]
(update token-set :items conj (:id token)))
(defn get-selected-token-set-id [state]
(get-in state [:workspace-local :selected-token-set-id]))
(defn get-selected-token-set [state]
(when-let [id (get-in state [:workspace-local :selected-token-set-id])]
(get-token-set state id)))
(when-let [id (get-selected-token-set-id state)]
(get-token-set id state)))
(defn get-token-set-tokens [{:keys [tokens] :as token-set} file]
(map #(get-in file [:data :tokens %]) tokens))
(defn assoc-selected-token-set-id [state id]
(assoc-in state [:workspace-local :selected-token-set-id] id))