archive shortcut

This commit is contained in:
Jeffrey Biles
2020-03-19 03:36:46 -07:00
parent 327e9b5835
commit 0127326c75
2 changed files with 3 additions and 1 deletions

View File

@@ -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])
}

View File

@@ -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);