Fix #90 - Blank page after deletion of all accounts

This commit is contained in:
Bubka 2022-06-20 22:40:35 +02:00
parent 498ef39f88
commit 2c5da9b85e

View File

@ -405,9 +405,14 @@
let ids = []
this.selectedAccounts.forEach(id => ids.push(id))
// Backend will delete all accounts at the same time
let that = this
await this.axios.delete('/api/v1/twofaccounts?ids=' + ids.join())
.then(response => {
ids.forEach(function(id) {
that.accounts = that.accounts.filter(a => a.id !== id)
})
})
// we fetch the accounts again to prevent the js collection being
// desynchronize from the backend php collection
this.fetchAccounts(true)