From ae1119cadf71ce34924a11bafce7988fbbf94ec1 Mon Sep 17 00:00:00 2001 From: verbiricha Date: Thu, 8 Feb 2024 10:50:26 +0100 Subject: [PATCH] fix: don't allow saving emoji sets without a name closes #4 --- apps/emojis/ui/new-emoji-set.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/emojis/ui/new-emoji-set.tsx b/apps/emojis/ui/new-emoji-set.tsx index d4bfa9e..ae86b55 100644 --- a/apps/emojis/ui/new-emoji-set.tsx +++ b/apps/emojis/ui/new-emoji-set.tsx @@ -102,6 +102,7 @@ export default function NewEmojiSet({ const canSign = useSigner(); const [name, setName] = useState(defaultName); const [emojis, setEmojis] = useState(defaultEmojis); + const canSave = canSign && name.trim().length > 0 function addEmoji(e: EmojiDefinition) { setEmojis(emojis.concat([e])); @@ -141,7 +142,7 @@ export default function NewEmojiSet({ ) : ( New emoji set )} - + Save