From 7014bc7a3c4df4b1fe4d1bbe2915c0db4c357838 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 9 Dec 2021 17:35:05 +0100 Subject: [PATCH] :bug: Fix issue when typography name is empty. --- common/src/app/common/pages/helpers.cljc | 2 +- frontend/src/app/main/data/workspace/libraries.cljs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/pages/helpers.cljc b/common/src/app/common/pages/helpers.cljc index 641867475..29d821a28 100644 --- a/common/src/app/common/pages/helpers.cljc +++ b/common/src/app/common/pages/helpers.cljc @@ -436,7 +436,7 @@ [path-name] (let [path-name-split (split-path path-name) path (str/join " / " (butlast path-name-split)) - name (last path-name-split)] + name (or (last path-name-split) "")] [path name])) (defn merge-path-item diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index e6c50d055..be4d97e8f 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -242,11 +242,11 @@ (watch [it state _] (let [[path name] (cp/parse-path-name (:name typography)) typography (assoc typography :path path :name name) - prev (get-in state [:workspace-data :typographies (:id typography)]) - rchg {:type :mod-typography - :typography typography} - uchg {:type :mod-typography - :typography prev}] + prev (get-in state [:workspace-data :typographies (:id typography)]) + rchg {:type :mod-typography + :typography typography} + uchg {:type :mod-typography + :typography prev}] (rx/of (dwu/start-undo-transaction) (dch/commit-changes {:redo-changes [rchg] :undo-changes [uchg]