Skip to content

Commit

Permalink
fix: disabled xcm transfer with Kusama parachains (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto authored Apr 3, 2023
1 parent a899b8b commit be9fcb6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/hooks/xcm/useTransferRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,15 @@ export function useTransferRouter() {
const isDisableXcmEnvironment = computed<boolean>(() => {
const isProductionPage = window.location.origin === productionOrigin;
const isDisabledXcmChain = disabledXcmChain === currentNetworkIdx.value;
// return isDisabledXcmChain && isProductionPage;

const originChain = token.value ? token.value.originChain : '';
return checkIsDisabledToken(originChain);
return checkIsDisabledToken(originChain) || (isDisabledXcmChain && isProductionPage);
});

const checkIsDisabledXcmChain = (from: string, to: string): boolean => {
if (!from || !to) return false;
const chains = disabledXcmParachains.map((it) => it.toLowerCase());
const isDisabled = chains.find((it) => it === from.toLowerCase() || it === to.toLowerCase());
// return !!isDisabled ||isDisableXcmEnvironment.value;

return !!isDisabled;
return !!isDisabled || isDisableXcmEnvironment.value;
};

// Memo: redirect to the assets page if users access to the XCM transfer page by inputting URL directly
Expand Down

0 comments on commit be9fcb6

Please sign in to comment.