Skip to content

Commit

Permalink
fix: don't allow saving emoji sets without a name
Browse files Browse the repository at this point in the history
closes #4
  • Loading branch information
verbiricha committed Feb 8, 2024
1 parent 0e8a4f3 commit ae1119c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/emojis/ui/new-emoji-set.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default function NewEmojiSet({
const canSign = useSigner();
const [name, setName] = useState<string>(defaultName);
const [emojis, setEmojis] = useState<EmojiDefinition[]>(defaultEmojis);
const canSave = canSign && name.trim().length > 0

function addEmoji(e: EmojiDefinition) {
setEmojis(emojis.concat([e]));
Expand Down Expand Up @@ -141,7 +142,7 @@ export default function NewEmojiSet({
) : (
<Heading>New emoji set</Heading>
)}
<AsyncButton isDisabled={!canSign} onClick={saveEmojiSet}>
<AsyncButton isDisabled={!canSave} onClick={saveEmojiSet}>
Save
</AsyncButton>
</HStack>
Expand Down

0 comments on commit ae1119c

Please sign in to comment.