Skip to content

Commit

Permalink
more efficient
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Martin <maximilian_martin@gmx.de>
  • Loading branch information
max65482 committed Jan 24, 2023
1 parent a3d1630 commit d7fa8dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/NewMessageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ export default {
if (!data.force && data.attachments.length === 0) {
var attachmentMissing = false
var lines = toPlain(data.body).value.toLowerCase().split("\n")
var lines = toPlain(data.body).value.toLowerCase().split('\n')
var wordAttachment = t('mail', 'attachment').toLowerCase()
var wordAttached = t('mail', 'attached').toLowerCase()
for (let line of lines) {
if (line.startsWith('>') || line.startsWith('--')) {
break
}
if (line.includes(t('mail', 'attachment').toLowerCase()) || line.includes(t('mail', 'attached').toLowerCase())) {
if (line.includes(wordAttachment) || line.includes(wordAttached)) {
attachmentMissing = true
break
}
Expand Down

0 comments on commit d7fa8dd

Please sign in to comment.