Skip to content

Commit 785feb2

Browse files
committed
prioritize navigation and publish to walletlink after
1 parent 8e99571 commit 785feb2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/wallet-sdk/src/sign/walletlink/relay/WalletLinkRelay.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { ScopedLocalStorage } from ':core/storage/ScopedLocalStorage.js';
66
import { Address } from ':core/type/index.js';
77
import { bigIntStringFromBigInt, hexStringFromBuffer, randomBytesHex } from ':core/type/util.js';
88
import {
9-
WalletLinkConnection,
10-
WalletLinkConnectionUpdateListener,
9+
WalletLinkConnection,
10+
WalletLinkConnectionUpdateListener,
1111
} from './connection/WalletLinkConnection.js';
1212
import { LOCAL_STORAGE_ADDRESSES_KEY } from './constants.js';
1313
import { RelayEventManager } from './RelayEventManager.js';
@@ -260,6 +260,13 @@ export class WalletLinkRelay implements WalletLinkConnectionUpdateListener {
260260

261261
private publishWeb3RequestEvent(id: string, request: Web3Request): void {
262262
const message: WalletLinkEventData = { type: 'WEB3_REQUEST', id, request };
263+
264+
// Fire deeplink immediately for mobile web to avoid Safari popup blocking
265+
if (this.isMobileWeb) {
266+
this.openCoinbaseWalletDeeplink(request.method);
267+
}
268+
269+
// Then publish the event asynchronously
263270
this.publishEvent('Web3Request', message, true)
264271
.then((_) => {})
265272
.catch((err) => {
@@ -268,10 +275,6 @@ export class WalletLinkRelay implements WalletLinkConnectionUpdateListener {
268275
errorMessage: err.message,
269276
});
270277
});
271-
272-
if (this.isMobileWeb) {
273-
this.openCoinbaseWalletDeeplink(request.method);
274-
}
275278
}
276279

277280
// copied from MobileRelay

0 commit comments

Comments
 (0)