File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Fix cb wallet transaction desktop popup when logged in via mobile QR code
Original file line number Diff line number Diff line change @@ -188,7 +188,17 @@ function createAccount({
188188 onTransactionRequested : async ( ) => {
189189 // make sure to show the coinbase popup BEFORE doing any transaction preprocessing
190190 // otherwise the popup might get blocked in safari
191- await showCoinbasePopup ( provider ) ;
191+ // but only if using cb smart wallet (web based)
192+ if ( window . localStorage ) {
193+ // this is the local storage key for the signer type in the cb web sdk
194+ // value can be "scw" (web) or "walletlink" (mobile wallet)
195+ const signerType = window . localStorage . getItem (
196+ "-CBWSDK:SignerConfigurator:SignerType" ,
197+ ) ;
198+ if ( signerType === "scw" ) {
199+ await showCoinbasePopup ( provider ) ;
200+ }
201+ }
192202 } ,
193203 async sendTransaction ( tx : SendTransactionOption ) {
194204 const transactionHash = ( await provider . request ( {
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export function wrapFetchWithPayment(
8282 parsedPaymentRequirements ,
8383 chain . id ,
8484 "exact" ,
85+ error ,
8586 ) ;
8687
8788 if ( ! selectedPaymentRequirements ) {
@@ -141,10 +142,11 @@ function defaultPaymentRequirementsSelector(
141142 paymentRequirements : RequestedPaymentRequirements [ ] ,
142143 chainId : number ,
143144 scheme : "exact" ,
145+ error ?: string ,
144146) {
145147 if ( ! paymentRequirements . length ) {
146148 throw new Error (
147- " No valid payment requirements found in server 402 response" ,
149+ ` No valid payment requirements found in server 402 response. ${ error } ` ,
148150 ) ;
149151 }
150152 const currentWalletNetwork = ChainIdToNetwork [ chainId ] || `eip155:${ chainId } ` ;
You can’t perform that action at this time.
0 commit comments