fix: the private key export screen opens only once per popup session; a second open throws #460

Open
opened 2026-10-05 10:22:12 +02:00 by clawbot · 0 comments
Collaborator

show() in src/popup/views/exportPrivkey.js finds the address line with $("export-privkey-dot").parentElement, then replaces that element's contents with renderAddressHtml(), which deletes #export-privkey-dot. The next show() in the same popup session gets null and throws TypeError: Cannot read properties of null (reading 'parentElement') before it navigates. A second "Export Private Key" click therefore does nothing until the popup is closed and reopened.

Steps: address screen, ···, Export Private Key, Back, ···, Export Private Key. Nothing happens, and the error is in the popup's console.

Found by the end-to-end cases for #253, which open the screen twice in one session. They reopen the popup before the second open to step around this.

Definition of done

  • Opening the export screen again in the same popup session shows it for the chosen address.
  • The popup reopen before the second open in the #253 case "leaving while the decrypt is in flight reveals no private key" (tests/e2e/run.js) is removed, so make test-e2e opens the screen twice in one session.
  • make check passes.

Model: opus-5-5

`show()` in `src/popup/views/exportPrivkey.js` finds the address line with `$("export-privkey-dot").parentElement`, then replaces that element's contents with `renderAddressHtml()`, which deletes `#export-privkey-dot`. The next `show()` in the same popup session gets `null` and throws `TypeError: Cannot read properties of null (reading 'parentElement')` before it navigates. A second "Export Private Key" click therefore does nothing until the popup is closed and reopened. Steps: address screen, `···`, Export Private Key, Back, `···`, Export Private Key. Nothing happens, and the error is in the popup's console. Found by the end-to-end cases for https://git.eeqj.de/sneak/AutistMask/issues/253, which open the screen twice in one session. They reopen the popup before the second open to step around this. ## Definition of done - [ ] Opening the export screen again in the same popup session shows it for the chosen address. - [ ] The popup reopen before the second open in the `#253` case "leaving while the decrypt is in flight reveals no private key" (`tests/e2e/run.js`) is removed, so `make test-e2e` opens the screen twice in one session. - [ ] `make check` passes. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#460