mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-20 14:25:14 +00:00
archive shortcut
This commit is contained in:
@@ -47,10 +47,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function changeEmail(emails, {amount, archive}){
|
||||
function changeEmail(emails, {amount, archive, closeModal}){
|
||||
let index = emails.findIndex(e => e == openedEmail.value);
|
||||
|
||||
if(archive) { emails[index].archived = true }
|
||||
if(closeModal) { openedEmail.value = null; return null; }
|
||||
|
||||
openEmail(emails[index + amount])
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
{key: 'j', fn: () => emit('changeEmail', {amount: 1})},
|
||||
{key: '[', fn: () => emit('changeEmail', {amount: -1, archive: true})},
|
||||
{key: ']', fn: () => emit('changeEmail', {amount: 1, archive: true})},
|
||||
{key: 'e', fn: () => emit('changeEmail', {archive: true, closeModal: true})}
|
||||
])
|
||||
|
||||
let emailMarkdown = marked(email.body);
|
||||
|
||||
Reference in New Issue
Block a user