Skip to content

Commit

Permalink
Add support for OmniKit links in getActionUrl.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinciarka committed Mar 26, 2024
1 parent 38870ec commit d81c553
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions features/productHub/helpers/getActionUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ export const getAaveLikeViewStrategyUrl = ({
strategy.tokens.debt.toLocaleLowerCase() === secondaryToken?.toLocaleLowerCase() &&
strategy.network === network,
)
const featureToggles = getLocalAppConfig('features')

if (
featureToggles.UseOmniKitLinks &&
search &&
[LendingProtocol.AaveV3, LendingProtocol.SparkV3].includes(search.protocol)
) {
return `/${search.network.toLocaleLowerCase()}/omni/${
{
[LendingProtocol.AaveV3]: 'aave/v3',
[LendingProtocol.SparkV3]: 'spark',
}[search.protocol as LendingProtocol.SparkV3 | LendingProtocol.AaveV3]
}/${search.type.toLocaleLowerCase()}/${search.tokens.collateral.toLocaleLowerCase()}-${search.tokens.debt.toLocaleLowerCase()}`
}

return !search?.urlSlug ||
(!bypassFeatureFlag &&
search?.featureToggle &&
!getLocalAppConfig('features')[search?.featureToggle])
(!bypassFeatureFlag && search?.featureToggle && !featureToggles[search?.featureToggle])
? '/'
: `/${network}/${aaveLikeProduct}/${version}/${search.type.toLocaleLowerCase()}/${
search!.urlSlug
Expand Down

0 comments on commit d81c553

Please sign in to comment.