Skip to content

Commit 9be951b

Browse files
committed
chore: add confirmation message
1 parent be68ade commit 9be951b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

apps/frontend/src/utils/account-debug.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@ export function impersonateAccount(address?: string) {
2020
throw new Error("It's not a valid Ethereum address.");
2121
}
2222
const lowercasedAddress = address.toLowerCase();
23-
if (typeof localStorage !== 'undefined') {
24-
localStorage.setItem('impersonate', lowercasedAddress);
25-
window.location.reload();
23+
24+
if (
25+
window.confirm(`You are about to impersonate the account: ${lowercasedAddress}
26+
This will set the address in localStorage and reload the page.
27+
To stop impersonation, run stopImpersonatingAccount() in the console.
28+
29+
Do you want to proceed?`)
30+
) {
31+
if (typeof localStorage !== 'undefined') {
32+
localStorage.setItem('impersonate', lowercasedAddress);
33+
window.location.reload();
34+
}
2635
}
2736
}
2837

0 commit comments

Comments
 (0)