File tree 2 files changed +27
-1
lines changed
packages/ethereum-wallets/src/lib
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ const EthereumWallets: WalletBehaviourFactory<
317
317
options . network . networkId ,
318
318
devMode ? address + "." + devModeAccount : address
319
319
) ;
320
- if ( ! keyPair ) {
320
+ if ( ! keyPair && ! skipSignInAccessKey ) {
321
321
try {
322
322
wagmiCore ! . disconnect ( wagmiConfig ) ;
323
323
} catch ( error ) {
@@ -591,6 +591,7 @@ const EthereumWallets: WalletBehaviourFactory<
591
591
for ( const [ index , tx ] of txs . entries ( ) ) {
592
592
let txHash ;
593
593
let txError : string | null = null ;
594
+ let showDetails = false ;
594
595
while ( ! txHash ) {
595
596
try {
596
597
await ( ( ) => {
@@ -599,13 +600,18 @@ const EthereumWallets: WalletBehaviourFactory<
599
600
selectedIndex : index ,
600
601
ethTxHashes,
601
602
error : txError ,
603
+ showDetails,
604
+ onShowDetails : ( state : boolean ) => {
605
+ showDetails = state ;
606
+ } ,
602
607
onConfirm : async ( ) => {
603
608
try {
604
609
txError = null ;
605
610
renderTxs ( {
606
611
selectedIndex : index ,
607
612
ethTxHashes,
608
613
error : txError ,
614
+ showDetails,
609
615
} ) ;
610
616
txHash = await executeTransaction ( {
611
617
tx,
Original file line number Diff line number Diff line change @@ -98,11 +98,15 @@ export function createTxModal({
98
98
selectedIndex,
99
99
ethTxHashes,
100
100
error,
101
+ showDetails,
102
+ onShowDetails,
101
103
onConfirm,
102
104
} : {
103
105
selectedIndex : number ;
104
106
ethTxHashes : Array < string > ;
105
107
error ?: string | null ;
108
+ onShowDetails ?: ( state : boolean ) => void ;
109
+ showDetails ?: boolean ;
106
110
onConfirm ?: ( ) => void ;
107
111
} ) => {
108
112
const container = document . querySelector (
@@ -339,6 +343,16 @@ export function createTxModal({
339
343
".ethereum-wallet-txs-details"
340
344
) as HTMLElement | null ;
341
345
346
+ if ( detailsContainer && toggleButton ) {
347
+ if ( showDetails ) {
348
+ detailsContainer . style . display = "block" ;
349
+ toggleButton . textContent = "Hide details" ;
350
+ } else {
351
+ detailsContainer . style . display = "none" ;
352
+ toggleButton . textContent = "Show details" ;
353
+ }
354
+ }
355
+
342
356
toggleButton ?. addEventListener ( "click" , ( ) => {
343
357
if ( ! detailsContainer || ! toggleButton ) {
344
358
return ;
@@ -350,9 +364,15 @@ export function createTxModal({
350
364
) {
351
365
detailsContainer . style . display = "block" ;
352
366
toggleButton . textContent = "Hide details" ;
367
+ if ( onShowDetails ) {
368
+ onShowDetails ( true ) ;
369
+ }
353
370
} else {
354
371
detailsContainer . style . display = "none" ;
355
372
toggleButton . textContent = "Show details" ;
373
+ if ( onShowDetails ) {
374
+ onShowDetails ( false ) ;
375
+ }
356
376
}
357
377
} ) ;
358
378
} ;
You can’t perform that action at this time.
0 commit comments