Allow to delete an account

This commit is contained in:
Rodolphe Bréard 2023-07-30 16:54:01 +02:00
parent ea50c4b65e
commit 6f165da1a1

View file

@ -37,7 +37,10 @@ const generatedAddr = computed(() => {
}
return '';
});
const deleteAccount = () => {
accounts.value = accounts.value.filter((e) => e.id !== selectedAccountId.value);
selectedAccountId.value = accounts.value[0].id;
};
const copyAddr = () => {
navigator.clipboard.writeText(generatedAddr.value);
};
@ -55,7 +58,7 @@ const copyAddr = () => {
</div>
</div>
<p class="control">
<a class="button is-danger">Delete</a>
<a class="button is-danger" @click="deleteAccount">Delete</a>
</p>
<p class="control">
<RouterLink to="/add-account" class="button is-primary">New</RouterLink>