From 048f813fc5d499dc3885960ef9b6623464974715 Mon Sep 17 00:00:00 2001 From: Ramu N Date: Wed, 18 Dec 2024 20:29:26 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20user=20feedback=20for=20e?= =?UTF-8?q?mpty/long=20group=20names=20in=20create/edit=20group=20modals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/SessionListContent/Modals/CreateGroupModal.tsx | 2 -- .../features/SessionListContent/Modals/RenameGroupModal.tsx | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/(main)/chat/@session/features/SessionListContent/Modals/CreateGroupModal.tsx b/src/app/(main)/chat/@session/features/SessionListContent/Modals/CreateGroupModal.tsx index d816d6bd1725..0b3e6ba6dc9d 100644 --- a/src/app/(main)/chat/@session/features/SessionListContent/Modals/CreateGroupModal.tsx +++ b/src/app/(main)/chat/@session/features/SessionListContent/Modals/CreateGroupModal.tsx @@ -35,8 +35,6 @@ const CreateGroupModal = memo( onCancel?.(e); }} onOk={async (e: MouseEvent) => { - if (!input) return; - if (input.length === 0 || input.length > 20) return message.warning(t('sessionGroup.tooLong')); diff --git a/src/app/(main)/chat/@session/features/SessionListContent/Modals/RenameGroupModal.tsx b/src/app/(main)/chat/@session/features/SessionListContent/Modals/RenameGroupModal.tsx index 07082055de78..22dbd61916e8 100644 --- a/src/app/(main)/chat/@session/features/SessionListContent/Modals/RenameGroupModal.tsx +++ b/src/app/(main)/chat/@session/features/SessionListContent/Modals/RenameGroupModal.tsx @@ -17,7 +17,7 @@ const RenameGroupModal = memo(({ id, open, onCancel }) => const updateSessionGroupName = useSessionStore((s) => s.updateSessionGroupName); const group = useSessionStore((s) => sessionGroupSelectors.getGroupById(id)(s), isEqual); - const [input, setInput] = useState(); + const [input, setInput] = useState(''); const [loading, setLoading] = useState(false); const { message } = App.useApp(); @@ -27,11 +27,10 @@ const RenameGroupModal = memo(({ id, open, onCancel }) => destroyOnClose okButtonProps={{ loading }} onCancel={(e) => { - setInput(group?.name); + setInput(group?.name ?? ''); onCancel?.(e); }} onOk={async (e) => { - if (!input) return; if (input.length === 0 || input.length > 20) return message.warning(t('sessionGroup.tooLong')); setLoading(true);