From b1cf641587189085417a78f5c9df269ef2357586 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Thu, 22 Aug 2024 14:56:41 +0200 Subject: [PATCH] Fix cancelling set prompt breaking user state --- frontend/src/app/main/ui/workspace/tokens/sidebar.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/sidebar.cljs b/frontend/src/app/main/ui/workspace/tokens/sidebar.cljs index c8275290a..e4af04813 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sidebar.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sidebar.cljs @@ -219,7 +219,8 @@ "🗑️"]]]])]])]] [:div.spaced [:b "Sets"] - [:button {:on-click #(st/emit! (wdt/create-token-set {:name (js/window.prompt "Set name")}))} "Create"]] + [:button {:on-click #(when-let [set-name (js/window.prompt "Set name")] + (st/emit! (wdt/create-token-set {:name set-name})))} "Create"]] [:ul.spaced-y (for [[_ {:keys [id name]}] token-sets] [:li {:class [(when (= selected-token-set-id id) "selected")]