diff --git a/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx b/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx index 528d261f4fab0..0380f63742d74 100644 --- a/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx +++ b/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx @@ -186,10 +186,9 @@ const CreateChannelModal = ({ teamId = '', mainRoom, onClose, reload }: CreateCh dispatchToastMessage({ type: 'success', message: t('Room_has_been_created') }); reload?.(); + onClose(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); - } finally { - onClose(); } }; diff --git a/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateTeamModal.tsx b/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateTeamModal.tsx index 87feeea766266..4b7410aa352f2 100644 --- a/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateTeamModal.tsx +++ b/apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateTeamModal.tsx @@ -146,11 +146,10 @@ const CreateTeamModal = ({ onClose }: CreateTeamModalProps) => { const { team } = await createTeamAction(params); dispatchToastMessage({ type: 'success', message: t('Team_has_been_created') }); goToRoomById(team.roomId); + onClose(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); - } finally { - onClose(); - } + } }; const createTeamFormId = useId();