Skip to content

Commit

Permalink
fix: fuck
Browse files Browse the repository at this point in the history
  • Loading branch information
NeOMakinG committed Sep 13, 2024
1 parent 7a6ebfb commit f79b7b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/pages/RFOX/components/AddressSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { validateAddress } from 'lib/address/address'
import {
selectAccountIdByAccountNumberAndChainId,
selectAccountNumberByAccountId,
selectPortfolioAccountIdsByAssetIdFilter,
} from 'state/slices/selectors'
import { useAppSelector } from 'state/store'

Expand Down Expand Up @@ -218,6 +219,11 @@ export const AddressSelection: FC<AddressSelectionProps> = ({
const filter = useMemo(() => ({ accountId: maybeRuneAccountId }), [maybeRuneAccountId])
const accountNumber = useAppSelector(state => selectAccountNumberByAccountId(state, filter))

const accountsFilter = useMemo(() => ({ assetId: thorchainAssetId }), [])
const runeAccounts = useAppSelector(state =>
selectPortfolioAccountIdsByAssetIdFilter(state, accountsFilter),
)

const CustomAddress = useCallback(() => {
if (!maybeSelectedRuneAddress)
return <Text translation='RFOX.noAddressFound' color='text.subtle' fontSize='sm' />
Expand All @@ -237,9 +243,9 @@ export const AddressSelection: FC<AddressSelectionProps> = ({
isDisabled={!maybeSelectedRuneAddress}
value={maybeSelectedRuneAddress ?? ''}
>
{(!Boolean(currentRuneAddress) && maybeRuneAccountId) ||
{(!Boolean(currentRuneAddress) && maybeRuneAccountId && setStepIndex) ||
accountNumber !== undefined ||
!setStepIndex ? (
(!setStepIndex && runeAccounts.length) ? (
<AccountDropdown
defaultAccountId={maybeRuneAccountId}
assetId={thorchainAssetId}
Expand All @@ -263,6 +269,7 @@ export const AddressSelection: FC<AddressSelectionProps> = ({
setStepIndex,
shouldDisableAccountDropdown,
accountNumber,
runeAccounts,
])

const addressSelectionLabel = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RFOX/components/Stake/StakeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const StakeInput: React.FC<StakeInputProps & StakeRouteProps> = ({
},
} = useRfoxStake({
amountCryptoBaseUnit,
runeAddress,
runeAddress: currentRuneAddress || runeAddress,
stakingAssetId,
stakingAssetAccountId,
hasEnoughBalance,
Expand Down

0 comments on commit f79b7b4

Please sign in to comment.