Skip to content

Commit 9c3016e

Browse files
authored
remove vpn check (#1855)
1 parent 1cb6c1e commit 9c3016e

File tree

3 files changed

+20
-33
lines changed

3 files changed

+20
-33
lines changed

src/app/earn/components/earn-widget/components/smart-trade-button.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function SmartTradeButton(props: SmartTradeButtonProps) {
5656

5757
const { chainId } = useNetwork()
5858
const { open } = useAppKit()
59-
const { isRestrictedCountry, isUsingVpn } = useProtectionContext()
59+
const { isRestrictedCountry } = useProtectionContext()
6060
const { slippage } = useSlippage()
6161

6262
const {
@@ -99,27 +99,21 @@ export function SmartTradeButton(props: SmartTradeButtonProps) {
9999
) {
100100
return [WarningType.restricted]
101101
}
102-
if (
103-
!isTradablePair &&
104-
isUsingVpn &&
105-
!hiddenWarnings?.includes(WarningType.vpn)
106-
) {
107-
return [WarningType.vpn]
108-
}
102+
// if (
103+
// !isTradablePair &&
104+
// isUsingVpn &&
105+
// !hiddenWarnings?.includes(WarningType.vpn)
106+
// ) {
107+
// return [WarningType.vpn]
108+
// }
109109
if (slippage > 9 && !hiddenWarnings?.includes(WarningType.priceImpact)) {
110110
return [WarningType.priceImpact]
111111
}
112112
if (!hiddenWarnings?.includes(WarningType.flashbots)) {
113113
return [WarningType.flashbots]
114114
}
115115
return []
116-
}, [
117-
hiddenWarnings,
118-
isRestrictedCountry,
119-
isTradablePair,
120-
isUsingVpn,
121-
slippage,
122-
])
116+
}, [hiddenWarnings, isRestrictedCountry, isTradablePair, slippage])
123117

124118
const onClick = useCallback(async () => {
125119
if (buttonState === TradeButtonState.connectWallet) {

src/components/smart-trade-button/index.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function SmartTradeButton(props: SmartTradeButtonProps) {
5353

5454
const { chainId } = useNetwork()
5555
const { open } = useAppKit()
56-
const { isRestrictedCountry, isUsingVpn } = useProtectionContext()
56+
const { isRestrictedCountry } = useProtectionContext()
5757
const { slippage } = useSlippage()
5858

5959
const {
@@ -96,27 +96,21 @@ export function SmartTradeButton(props: SmartTradeButtonProps) {
9696
) {
9797
return [WarningType.restricted]
9898
}
99-
if (
100-
!isTradablePair &&
101-
isUsingVpn &&
102-
!hiddenWarnings?.includes(WarningType.vpn)
103-
) {
104-
return [WarningType.vpn]
105-
}
99+
// if (
100+
// !isTradablePair &&
101+
// isUsingVpn &&
102+
// !hiddenWarnings?.includes(WarningType.vpn)
103+
// ) {
104+
// return [WarningType.vpn]
105+
// }
106106
if (slippage > 9 && !hiddenWarnings?.includes(WarningType.priceImpact)) {
107107
return [WarningType.priceImpact]
108108
}
109109
if (!hiddenWarnings?.includes(WarningType.flashbots)) {
110110
return [WarningType.flashbots]
111111
}
112112
return []
113-
}, [
114-
hiddenWarnings,
115-
isRestrictedCountry,
116-
isTradablePair,
117-
isUsingVpn,
118-
slippage,
119-
])
113+
}, [hiddenWarnings, isRestrictedCountry, isTradablePair, slippage])
120114

121115
const onClick = useCallback(async () => {
122116
if (buttonState === TradeButtonState.connectWallet) {

src/lib/hooks/use-is-token-pair-tradable.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export function useIsTokenPairTradable(
66
outputTokenSymbol: string,
77
chainId: number,
88
): boolean {
9-
const { isForbiddenAddress, isRestrictedCountry, isUsingVpn } =
10-
useProtectionContext()
9+
const { isForbiddenAddress, isRestrictedCountry } = useProtectionContext()
1110
if (isForbiddenAddress) return false
12-
if (!isRestrictedCountry && !isUsingVpn) return true
11+
if (!isRestrictedCountry) return true
1312
// When tokenlists is used everywhere, we can just pass these objects as function
1413
// arguments instead of the token symbol
1514
const outputToken = getTokenByChainAndSymbol(chainId, outputTokenSymbol)

0 commit comments

Comments
 (0)