mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-04-11 19:18:26 +02:00
Fix selected accounts deletion in Management mode
This commit is contained in:
parent
7ebadf278f
commit
5b9be6a8b9
@ -146,9 +146,12 @@ export const useTwofaccounts = defineStore({
|
|||||||
if(confirm(trans('twofaccounts.confirm.delete')) && this.selectedIds.length > 0) {
|
if(confirm(trans('twofaccounts.confirm.delete')) && this.selectedIds.length > 0) {
|
||||||
await twofaccountService.batchDelete(this.selectedIds.join())
|
await twofaccountService.batchDelete(this.selectedIds.join())
|
||||||
.then(response => {
|
.then(response => {
|
||||||
selectedIds.forEach(function(id) {
|
let remainingItems = this.items
|
||||||
this.items = this.items.filter(a => a.id !== id)
|
this.selectedIds.forEach(function(id) {
|
||||||
|
remainingItems = remainingItems.filter(a => a.id !== id)
|
||||||
})
|
})
|
||||||
|
this.items = remainingItems
|
||||||
|
this.selectNone()
|
||||||
useNotifyStore().success({ text: trans('twofaccounts.accounts_deleted') })
|
useNotifyStore().success({ text: trans('twofaccounts.accounts_deleted') })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
import { vDraggable } from 'vue-draggable-plus'
|
import { vDraggable } from 'vue-draggable-plus'
|
||||||
|
|
||||||
const $2fauth = inject('2fauth')
|
const $2fauth = inject('2fauth')
|
||||||
|
const router = useRouter()
|
||||||
const notify = useNotifyStore()
|
const notify = useNotifyStore()
|
||||||
const user = useUserStore()
|
const user = useUserStore()
|
||||||
const bus = useBusStore()
|
const bus = useBusStore()
|
||||||
@ -202,6 +203,17 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes selected accounts
|
||||||
|
*/
|
||||||
|
async function deleteAccounts() {
|
||||||
|
await twofaccounts.deleteSelected()
|
||||||
|
|
||||||
|
if (twofaccounts.isEmpty) {
|
||||||
|
router.push({ name: 'start' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -333,7 +345,7 @@
|
|||||||
v-model:inManagementMode="bus.inManagementMode"
|
v-model:inManagementMode="bus.inManagementMode"
|
||||||
:areDisabled="twofaccounts.hasNoneSelected"
|
:areDisabled="twofaccounts.hasNoneSelected"
|
||||||
@move-button-clicked="showDestinationGroupSelector = true"
|
@move-button-clicked="showDestinationGroupSelector = true"
|
||||||
@delete-button-clicked="twofaccounts.deleteSelected()"
|
@delete-button-clicked="deleteAccounts"
|
||||||
@export-button-clicked="twofaccounts.export()">
|
@export-button-clicked="twofaccounts.export()">
|
||||||
</ActionButtons>
|
</ActionButtons>
|
||||||
</VueFooter>
|
</VueFooter>
|
||||||
|
Loading…
Reference in New Issue
Block a user