Skip to content

Commit 4a77f2b

Browse files
Merge pull request #502 from reown-com/chore/reject-alert
fix: show rejection alert in case the user rejects the connection
2 parents 048885f + b73fdb4 commit 4a77f2b

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

examples/expo-multichain/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/expo-multichain/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"typescript": "~5.9.2"
7777
},
7878
"overrides": {
79-
"react": "19.1.0"
79+
"react": "19.1.0",
80+
"hono": "4.10.3"
8081
},
8182
"private": true
8283
}

packages/appkit/src/views/w3m-connecting-view/index.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export function ConnectingView() {
3232
const onRetry = () => {
3333
if (CoreHelperUtil.isAllowedRetry(lastRetry)) {
3434
setLastRetry(Date.now());
35-
WcController.clearUri();
3635
initializeConnection(true);
3736
} else {
3837
SnackController.showError('Please wait a second before retrying');
@@ -46,6 +45,7 @@ export function ConnectingView() {
4645
const isPairingExpired = CoreHelperUtil.isPairingExpired(wcPairingExpiry);
4746
if (retry || isPairingExpired) {
4847
WcController.setWcError(false);
48+
WcController.clearUri();
4949

5050
const connectPromise = connect({
5151
wallet: routeData?.wallet
@@ -56,17 +56,6 @@ export function ConnectingView() {
5656
} catch (error) {
5757
LogController.sendError(error, 'ConnectingView.tsx', 'initializeConnection');
5858
WcController.setWcError(true);
59-
WcController.clearUri();
60-
61-
const currentRetryTime = retryTimestamp ?? lastRetry;
62-
63-
if (isQr && CoreHelperUtil.isAllowedRetry(currentRetryTime)) {
64-
const newRetryTime = Date.now();
65-
setLastRetry(newRetryTime);
66-
initializeConnection(true, newRetryTime);
67-
68-
return;
69-
}
7059

7160
const isUserRejected = ErrorUtil.isUserRejectedRequestError(error);
7261
const isProposalExpired = ErrorUtil.isProposalExpiredError(error);
@@ -83,6 +72,13 @@ export function ConnectingView() {
8372
message: (error as Error)?.message ?? 'Unknown'
8473
}
8574
});
75+
76+
const currentRetryTime = retryTimestamp ?? lastRetry;
77+
if (isQr && CoreHelperUtil.isAllowedRetry(currentRetryTime)) {
78+
const newRetryTime = Date.now();
79+
setLastRetry(newRetryTime);
80+
initializeConnection(true, newRetryTime);
81+
}
8682
}
8783
};
8884

0 commit comments

Comments
 (0)