Skip to content

Commit b93c492

Browse files
authored
Merge pull request #1221 from aurora-is-near/pa/show-details
Ethereum tx show details - skipSignInAccessKey bugfix
2 parents 21049d4 + f5249d7 commit b93c492

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

packages/ethereum-wallets/src/lib/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ const EthereumWallets: WalletBehaviourFactory<
317317
options.network.networkId,
318318
devMode ? address + "." + devModeAccount : address
319319
);
320-
if (!keyPair) {
320+
if (!keyPair && !skipSignInAccessKey) {
321321
try {
322322
wagmiCore!.disconnect(wagmiConfig);
323323
} catch (error) {
@@ -591,6 +591,7 @@ const EthereumWallets: WalletBehaviourFactory<
591591
for (const [index, tx] of txs.entries()) {
592592
let txHash;
593593
let txError: string | null = null;
594+
let showDetails = false;
594595
while (!txHash) {
595596
try {
596597
await (() => {
@@ -599,13 +600,18 @@ const EthereumWallets: WalletBehaviourFactory<
599600
selectedIndex: index,
600601
ethTxHashes,
601602
error: txError,
603+
showDetails,
604+
onShowDetails: (state: boolean) => {
605+
showDetails = state;
606+
},
602607
onConfirm: async () => {
603608
try {
604609
txError = null;
605610
renderTxs({
606611
selectedIndex: index,
607612
ethTxHashes,
608613
error: txError,
614+
showDetails,
609615
});
610616
txHash = await executeTransaction({
611617
tx,

packages/ethereum-wallets/src/lib/modal.ts

+20
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,15 @@ export function createTxModal({
9898
selectedIndex,
9999
ethTxHashes,
100100
error,
101+
showDetails,
102+
onShowDetails,
101103
onConfirm,
102104
}: {
103105
selectedIndex: number;
104106
ethTxHashes: Array<string>;
105107
error?: string | null;
108+
onShowDetails?: (state: boolean) => void;
109+
showDetails?: boolean;
106110
onConfirm?: () => void;
107111
}) => {
108112
const container = document.querySelector(
@@ -339,6 +343,16 @@ export function createTxModal({
339343
".ethereum-wallet-txs-details"
340344
) as HTMLElement | null;
341345

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+
342356
toggleButton?.addEventListener("click", () => {
343357
if (!detailsContainer || !toggleButton) {
344358
return;
@@ -350,9 +364,15 @@ export function createTxModal({
350364
) {
351365
detailsContainer.style.display = "block";
352366
toggleButton.textContent = "Hide details";
367+
if (onShowDetails) {
368+
onShowDetails(true);
369+
}
353370
} else {
354371
detailsContainer.style.display = "none";
355372
toggleButton.textContent = "Show details";
373+
if (onShowDetails) {
374+
onShowDetails(false);
375+
}
356376
}
357377
});
358378
};

0 commit comments

Comments
 (0)