From 48a0f36f417376b53c52df73fe3331f5d9052923 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sat, 9 Sep 2023 22:31:59 +0200 Subject: [PATCH] fix undefined account --- src/components/modals/SettingsModal.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/modals/SettingsModal.jsx b/src/components/modals/SettingsModal.jsx index c8995fdb..fbc33981 100755 --- a/src/components/modals/SettingsModal.jsx +++ b/src/components/modals/SettingsModal.jsx @@ -30,8 +30,10 @@ const SettingsModal = ({ isOpen, closeModal }) => { const { accounts } = useAccounts(); const accountJson = useMemo(() => { - const { plebbit, ...restOfAccount } = account; - return stringify({ account: restOfAccount }); + if (account) { + const { plebbit, ...restOfAccount } = account; + return stringify({ account: restOfAccount }); + } }, [account]); const [editedAccountJson, setEditedAccountJson] = useState(accountJson);