Skip to content

Commit 3e5abfc

Browse files
committed
fixed provider issues
1 parent aac514e commit 3e5abfc

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

wormhole-connect/src/AppRouter.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { clearWallets } from './store/wallet';
2020
import { clearPorticoBridge } from 'store/porticoBridge';
2121
import { useExternalSearch } from 'hooks/useExternalSearch';
2222
import { clearNtt } from 'store/ntt';
23+
import { wh } from 'utils/sdk';
2324

2425
const useStyles = makeStyles()((theme: any) => ({
2526
appContent: {
@@ -73,6 +74,7 @@ function AppRouter({ config }: Props) {
7374
dispatch(clearRedeem());
7475
dispatch(clearWallets());
7576
dispatch(clearNtt());
77+
wh.registerProviders(); // reset any providers that may have been set (e.g. signer.provider)
7678
}
7779
// reset transfer state on leave
7880
if (prevRoute === bridgeRoute && route !== bridgeRoute) {

wormhole-connect/src/views/Bridge/Send.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ function Send(props: { valid: boolean }) {
107107
try {
108108
const fromConfig = config.chains[fromChain!];
109109
if (fromConfig?.context === Context.ETH) {
110-
registerWalletSigner(fromChain!, TransferWallet.SENDING);
111110
const chainId = fromConfig.chainId;
112111
if (typeof chainId !== 'number') {
113112
throw new Error('invalid evm chain ID');
114113
}
115114
await switchChain(chainId, TransferWallet.SENDING);
115+
registerWalletSigner(fromChain!, TransferWallet.SENDING);
116116
}
117117
if (fromConfig?.context === Context.COSMOS) {
118118
await switchChain(fromConfig.chainId, TransferWallet.SENDING);

wormhole-connect/src/views/Redeem/NttInboundQueued.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ const NttInboundQueued = () => {
9797
try {
9898
const toConfig = CHAINS[toChain];
9999
if (toConfig?.context === Context.ETH) {
100-
registerWalletSigner(toChain, TransferWallet.RECEIVING);
101100
await switchChain(toConfig.chainId, TransferWallet.RECEIVING);
101+
registerWalletSigner(toChain, TransferWallet.RECEIVING);
102102
}
103103
tx = await nttRoute.completeInboundQueuedTransfer(
104104
toChain,

wormhole-connect/src/views/Redeem/SendTo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ function SendTo() {
201201
chainConfig!.context === Context.ETH &&
202202
typeof chainConfig.chainId === 'number'
203203
) {
204-
registerWalletSigner(txData.toChain, TransferWallet.RECEIVING);
205204
await switchChain(chainConfig.chainId, TransferWallet.RECEIVING);
205+
registerWalletSigner(txData.toChain, TransferWallet.RECEIVING);
206206
}
207207
if (!signedMessage) {
208208
throw new Error('failed to get vaa, cannot redeem');

0 commit comments

Comments
 (0)