Clean previously generated address

This commit is contained in:
Rodolphe Bréard 2023-07-25 23:11:03 +02:00
parent 5bfaac7c54
commit 04189f7e7c

View file

@ -175,6 +175,13 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelector('#generated-addr').value = new_address;
console.log(`New sub-address for account ${account.getName()}: ${new_address}`);
});
// Add a change event on the main form to remove previously generated address
['#account-name', '#sub-addr-name'].forEach((selector) => {
document.querySelector(selector).addEventListener('change', () => {
document.querySelector('#generated-addr').value = '';
});
});
});
window.addEventListener('load', () => {