Skip to content

Commit 7992da2

Browse files
committed
disable tb route when tbtc avail
1 parent b1f4af6 commit 7992da2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

wormhole-connect/src/hooks/useFetchSupportedRoutes.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const useFetchSupportedRoutes = (): HookReturn => {
4040

4141
const getSupportedRoutes = async () => {
4242
setIsFetching(true);
43-
const _routes: string[] = [];
43+
let _routes: string[] = [];
4444
await config.routes.forEach(async (name, route) => {
4545
// Disable manual routes when the receiving wallet is a ReadOnlyWallet
4646
// because the receiving wallet can't sign/complete the transaction
@@ -91,6 +91,15 @@ const useFetchSupportedRoutes = (): HookReturn => {
9191
}
9292
});
9393

94+
// HAX - We don't want users to use the token bridge route when the TBTC route is available
95+
// or they might receive frankenstein TBTC
96+
if (_routes.includes('ManualTBTC')) {
97+
_routes = _routes.filter(
98+
(route) =>
99+
!['ManualTokenBridge', 'AutomaticTokenBridge'].includes(route),
100+
);
101+
}
102+
94103
if (isActive) {
95104
setIsFetching(false);
96105
setRoutes(_routes);

0 commit comments

Comments
 (0)