chore: use findIndex to remove caldav token

This commit is contained in:
kolaente 2021-12-14 21:30:01 +01:00
parent cb067461aa
commit 0299ed32f3
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

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