chore: use findIndex to remove caldav token

This commit is contained in:
kolaente 2021-12-14 21:30:01 +01:00
parent 4f7a78b432
commit c49fd997d2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 7 deletions

View File

@ -109,13 +109,10 @@ const deleteToken = (token: CaldavTokenModel) => {
// @ts-ignore
.then(r => {
success(r)
for (const i in tokens.value) {
// @ts-ignore
if (tokens.value[i].id === token.id) {
// @ts-ignore
tokens.value.splice(i, 1)
}
}
// @ts-ignore
const i = tokens.value.findIndex(v => v.id === token.id)
// @ts-ignore
tokens.value.splice(i, 1)
})
}
</script>