fix issue with reading pubkey from non phantom wallets on account page

This commit is contained in:
tjs 2022-03-01 21:17:47 -05:00
parent 7a9dfc2b68
commit 5dc40a2078
2 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,9 @@ const BalancesTable = ({
const isMobile = width ? width < breakpoints.md : false
const mangoAccount = useMangoStore((s) => s.selectedMangoAccount.current)
const wallet = useMangoStore((s) => s.wallet.current)
const canWithdraw = mangoAccount?.owner.equals(wallet.publicKey)
const canWithdraw = wallet?.publicKey
? mangoAccount?.owner.equals(wallet.publicKey)
: true
const { asPath } = useRouter()
const handleSizeClick = (size, symbol) => {

View File

@ -91,7 +91,9 @@ export default function Account() {
const isMobile = width ? width < breakpoints.sm : false
const { pubkey } = router.query
const isDelegatedAccount = !mangoAccount?.owner.equals(wallet?.publicKey)
const isDelegatedAccount = wallet?.publicKey
? !mangoAccount?.owner?.equals(wallet?.publicKey)
: false
const handleCloseAlertModal = useCallback(() => {
setShowAlertsModal(false)