mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-11 18:54:31 +00:00
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user