From ef201f0f83099a40410ad1a69fccd65ccefb775e Mon Sep 17 00:00:00 2001 From: saml33 Date: Tue, 21 Nov 2023 22:22:29 +1100 Subject: [PATCH] close settings modal after account close --- components/account/CreateAccountForm.tsx | 2 +- components/modals/CloseAccountModal.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/account/CreateAccountForm.tsx b/components/account/CreateAccountForm.tsx index 1c2c6f80..546e2658 100644 --- a/components/account/CreateAccountForm.tsx +++ b/components/account/CreateAccountForm.tsx @@ -113,7 +113,7 @@ const CreateAccountForm = ({ } return loading ? ( -
+
) : ( diff --git a/components/modals/CloseAccountModal.tsx b/components/modals/CloseAccountModal.tsx index 335a10db..df126e00 100644 --- a/components/modals/CloseAccountModal.tsx +++ b/components/modals/CloseAccountModal.tsx @@ -15,11 +15,13 @@ import { ExclamationCircleIcon, TrashIcon } from '@heroicons/react/20/solid' import useUnsettledPerpPositions from 'hooks/useUnsettledPerpPositions' import { getMultipleAccounts } from '@project-serum/anchor/dist/cjs/utils/rpc' import { formatCurrencyValue } from 'utils/numbers' +import TopBarStore from '@store/topBarStore' const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { const { t } = useTranslation(['close-account']) const [loading, setLoading] = useState(false) const set = mangoStore((s) => s.set) + const { setShowSettingsModal } = TopBarStore() const openOrders = Object.values(mangoStore((s) => s.mangoAccount.openOrders)) const connection = mangoStore.getState().connection const hasOpenOrders = @@ -61,6 +63,7 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { setLoading(false) onClose() + setShowSettingsModal(false) notify({ title: t('account-closed'), type: 'success',