From d5dd049f438705c24fb165c13e1fdfcd7e65fd91 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 24 Apr 2023 08:44:29 +0700 Subject: [PATCH] fix duplicate channel list item --- src/components/channels/createChannelModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/channels/createChannelModal.tsx b/src/components/channels/createChannelModal.tsx index 8b7e1dcd..052ad704 100644 --- a/src/components/channels/createChannelModal.tsx +++ b/src/components/channels/createChannelModal.tsx @@ -48,8 +48,6 @@ export const CreateChannelModal = () => { // publish channel pool.publish(event, MESSAGE_RELAYS); - // insert to database - createChannel(event.id, event.content, event.created_at); // update jotai state setChannel((prev: any) => [ ...prev, @@ -62,6 +60,8 @@ export const CreateChannelModal = () => { // reset form reset(); setTimeout(() => { + // insert to database + createChannel(event.id, event.content, event.created_at); // close modal setOpen(false); // redirect to channel page