diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 4241c42a0..ec8bb4775 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -856,13 +856,13 @@ (defmethod process-change :mod-token-set [data {:keys [name token-set]}] - (update data :tokens-lib (fn [element] + (update data :tokens-lib (fn [lib] (let [path-changed? (not= name (:name token-set)) - lib (-> element - (ctob/ensure-tokens-lib) - (ctob/update-set name (fn [prev-set] - (merge prev-set (dissoc token-set :tokens)))))] - (cond-> lib + lib' (-> lib + (ctob/ensure-tokens-lib) + (ctob/update-set name (fn [prev-set] + (merge prev-set (dissoc token-set :tokens)))))] + (cond-> lib' path-changed? (ctob/update-set-name name (:name token-set))))))) (defmethod process-change :del-token-set