Allow to delete an account
This commit is contained in:
parent
ea50c4b65e
commit
6f165da1a1
1 changed files with 5 additions and 2 deletions
|
@ -37,7 +37,10 @@ const generatedAddr = computed(() => {
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
});
|
});
|
||||||
|
const deleteAccount = () => {
|
||||||
|
accounts.value = accounts.value.filter((e) => e.id !== selectedAccountId.value);
|
||||||
|
selectedAccountId.value = accounts.value[0].id;
|
||||||
|
};
|
||||||
const copyAddr = () => {
|
const copyAddr = () => {
|
||||||
navigator.clipboard.writeText(generatedAddr.value);
|
navigator.clipboard.writeText(generatedAddr.value);
|
||||||
};
|
};
|
||||||
|
@ -55,7 +58,7 @@ const copyAddr = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<a class="button is-danger">Delete</a>
|
<a class="button is-danger" @click="deleteAccount">Delete</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<RouterLink to="/add-account" class="button is-primary">New</RouterLink>
|
<RouterLink to="/add-account" class="button is-primary">New</RouterLink>
|
||||||
|
|
Loading…
Reference in a new issue