fix undefined account

This commit is contained in:
plebeius.eth
2023-09-09 22:31:59 +02:00
parent e2eb48e37d
commit 48a0f36f41
+4 -2
View File
@@ -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);