Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: Remove pre-minted BPT from withdrawal options #3838

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import WithdrawPreviewModal from './components/WithdrawPreviewModal/WithdrawPrev
import { useTokens } from '@/providers/tokens.provider';
import {
isPreMintedBptType,
tokensListExclBpt,
usePoolHelpers,
} from '@/composables/usePoolHelpers';
import { useI18n } from 'vue-i18n';
Expand Down Expand Up @@ -71,15 +72,17 @@ const hasValidInputs = computed(
(): boolean => validAmounts.value && hasAcceptedHighPriceImpact.value
);

const tokensList = computed(() => tokensListExclBpt(pool.value));

// Limit token select modal to a subset.
const subsetTokens = computed((): string[] => {
if (!pool.value.isInRecoveryMode && isPreMintedBptType(pool.value.poolType))
return [];

if (isWrappedNativeAssetPool.value)
return [nativeAsset.address, ...pool.value.tokensList];
return [nativeAsset.address, ...tokensList.value];

return pool.value.tokensList;
return tokensList.value;
});

const excludedTokens = computed((): string[] => {
Expand All @@ -100,7 +103,7 @@ onBeforeMount(() => {

singleAmountOut.address = shouldUseSwapExit.value
? wrappedNativeAsset.value.address
: pool.value.tokensList[0];
: tokensList.value[0];
});
</script>

Expand Down