mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-24 07:55:34 +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);
|
let index = emails.findIndex(e => e == openedEmail.value);
|
||||||
|
|
||||||
if(archive) { emails[index].archived = true }
|
if(archive) { emails[index].archived = true }
|
||||||
|
if(closeModal) { openedEmail.value = null; return null; }
|
||||||
|
|
||||||
openEmail(emails[index + amount])
|
openEmail(emails[index + amount])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
{key: 'j', fn: () => emit('changeEmail', {amount: 1})},
|
{key: 'j', fn: () => emit('changeEmail', {amount: 1})},
|
||||||
{key: '[', fn: () => emit('changeEmail', {amount: -1, archive: true})},
|
{key: '[', fn: () => emit('changeEmail', {amount: -1, archive: true})},
|
||||||
{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);
|
let emailMarkdown = marked(email.body);
|
||||||
|
|||||||
Reference in New Issue
Block a user