diff --git a/src/components/MailTable.vue b/src/components/MailTable.vue index 3515e2a..cce0d48 100644 --- a/src/components/MailTable.vue +++ b/src/components/MailTable.vue @@ -21,7 +21,7 @@ - + @@ -47,16 +47,15 @@ } } - return {format, emailSelection, openedEmail, openEmail} - }, - methods: { - changeEmail({amount, archive}) { - let index = this.emails.findIndex(e => e == this.openedEmail); + function changeEmail(emails, {amount, archive}){ + let index = emails.findIndex(e => e == openedEmail.value); - if(archive) { this.emails[index].archived = true } + if(archive) { emails[index].archived = true } - this.openEmail(this.emails[index + amount]) + openEmail(emails[index + amount]) } + + return {format, emailSelection, openedEmail, openEmail, changeEmail} }, props: { emails: {