This fixes the "archived emails stick around" issue... but I want to be able to do it with the setup function

This commit is contained in:
Jeffrey Biles
2020-03-19 03:26:08 -07:00
parent d427f80182
commit a495f6141c

View File

@@ -47,15 +47,16 @@
}
}
let changeEmail = function({amount, archive}){
let index = emails.findIndex(e => e == openedEmail.value);
return {format, emailSelection, openedEmail, openEmail}
},
methods: {
changeEmail({amount, archive}) {
let index = this.emails.findIndex(e => e == this.openedEmail);
if(archive) { emails[index].archived = true }
if(archive) { this.emails[index].archived = true }
openEmail(emails[index + amount])
this.openEmail(this.emails[index + amount])
}
return {format, emailSelection, openedEmail, openEmail, changeEmail}
},
props: {
emails: {