fix token positions slots error display

This commit is contained in:
saml33 2023-11-22 11:06:52 +11:00
parent a5c06e4e3c
commit a8363d944f
4 changed files with 10 additions and 13 deletions

View File

@ -21,19 +21,16 @@ export default function useTokenPositionsFull(banks: Array<Bank | undefined>) {
}
}
const availableTokenPositions = totalTokens.length - usedTokens.length
if (
banks.length === 2 &&
(alreadyHasPositionCount === 2 || availableTokenPositions >= 2)
alreadyHasPositionCount === banks.length ||
availableTokenPositions >= banks.length ||
(banks.length === 2 &&
alreadyHasPositionCount &&
alreadyHasPositionCount === availableTokenPositions)
) {
return false
}
if (
banks.length === 1 &&
(alreadyHasPositionCount === 1 || availableTokenPositions >= 1)
) {
return false
}
return true
} else return true
}, [banks, usedTokens, totalTokens])
return tokenPositionsFull

View File

@ -82,7 +82,7 @@
"equity": "Equity",
"error-borrow-exceeds-limit": "Maximum borrow for the current period is {{remaining}}. New period starts {{resetTime}}",
"error-repay-insufficient-funds": "Not enough {{token}} in your wallet to repay this amount",
"error-token-positions-full": "Not enough token positions available in your account",
"error-token-positions-full": "You've used all of your token account slots. Close unused slots to add this token to your account.",
"explore": "Explore",
"explorer": "Explorer",
"fee": "Fee",

View File

@ -82,7 +82,7 @@
"equity": "Equity",
"error-borrow-exceeds-limit": "Maximum borrow for the current period is {{remaining}}. New period starts {{resetTime}}",
"error-repay-insufficient-funds": "Not enough {{token}} in your wallet to repay this amount",
"error-token-positions-full": "Not enough token positions available in your account",
"error-token-positions-full": "You've used all of your token account slots. Close unused slots to add this token to your account.",
"explore": "Explore",
"explorer": "Explorer",
"fee": "Fee",

View File

@ -82,7 +82,7 @@
"equity": "Equity",
"error-borrow-exceeds-limit": "Maximum borrow for the current period is {{remaining}}. New period starts {{resetTime}}",
"error-repay-insufficient-funds": "Not enough {{token}} in your wallet to repay this amount",
"error-token-positions-full": "Not enough token positions available in your account",
"error-token-positions-full": "You've used all of your token account slots. Close unused slots to add this token to your account.",
"explore": "Explore",
"explorer": "Explorer",
"fee": "Fee",