handle when publicKey is not loaded

This commit is contained in:
tjs 2022-03-18 14:32:27 -04:00
parent 0b700a7fbe
commit 15fd691526
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ export default function AccountInfo() {
const [showWithdrawModal, setShowWithdrawModal] = useState(false)
const [showAlertsModal, setShowAlertsModal] = useState(false)
const canWithdraw = mangoAccount?.owner.equals(wallet.publicKey)
const canWithdraw =
mangoAccount?.owner && wallet?.publicKey
? mangoAccount?.owner?.equals(wallet?.publicKey)
: false
const handleCloseDeposit = useCallback(() => {
setShowDepositModal(false)