Skip to content

Commit

Permalink
fixup! warn about missing attachments
Browse files Browse the repository at this point in the history
Signed-off-by: greta <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Sep 29, 2023
1 parent 1c295d7 commit fd9e7a7
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions src/components/NewMessageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
:smime-encrypt="composerData.smimeEncrypt"
:is-first-open="modalFirstOpen"
:request-mdn="composerData.requestMdn"
:accounts="accounts"
@update:from-account="patchComposerData({ accountId: $event })"
@update:from-alias="patchComposerData({ aliasId: $event })"
@update:to="patchComposerData({ to: $event })"
Expand Down Expand Up @@ -139,12 +138,6 @@ export default {
NcActionButton,
MinimizeIcon,
},
props: {
accounts: {
type: Array,
required: true,
},
},
data() {
return {
toolbarElements: undefined,
Expand Down Expand Up @@ -227,7 +220,7 @@ export default {
let idToReturn
const dataForServer = this.getDataForServer(data, true)
if (!id) {
const { id } = await saveDraft(dataForServer)
const { id } = await saveDraft(data.account, dataForServer)
dataForServer.id = id
await this.$store.dispatch('patchComposerData', { id, draftId: dataForServer.draftId })
this.canSaveDraft = true
Expand Down Expand Up @@ -336,26 +329,15 @@ export default {
}
if (!this.composerData.id) {
// This is a new message
const { id } = await saveDraft(dataForServer)
const { id } = await saveDraft(data.account, dataForServer)
dataForServer.id = id
await this.$store.dispatch('outbox/enqueueFromDraft', {
draftMessage: dataForServer,
id,
})
} else if (this.composerData.type === 0) {
// This is an outbox message
dataForServer.id = this.composerData.id
await this.$store.dispatch('outbox/updateMessage', {
await this.$store.dispatch('outbox/enqueueMessage', {
message: dataForServer,
id: this.composerData.id,
})
} else {
// This is a draft
await updateDraft(dataForServer)
dataForServer.id = this.composerData.id
await this.$store.dispatch('outbox/enqueueFromDraft', {
draftMessage: dataForServer,
await this.$store.dispatch('outbox/updateMessage', {
message: dataForServer,
id: this.composerData.id,
})
}
Expand All @@ -380,19 +362,17 @@ export default {
return t('mail', 'You are trying to send to many recipients in To and/or Cc. Consider using Bcc to hide recipient addresses.')
},
default(error) {
if (error && error.toString) {
return error.toString()
}
logger.error('You are trying to send to many recipients in To and/or Cc. Consider using Bcc to hide recipient addresses.', error)
return t('mail', 'You are trying to send to many recipients in To and/or Cc. Consider using Bcc to hide recipient addresses.')
},
})
this.warning = await matchError(error, {
[AttachmentMissingError.getName()]() {
return t('mail', 'You mentioned an attachment. Did you forget to add it?')
},
default(error) {
if (error && error.toString) {
return error.toString()
}
logger.error('You mentioned an attachment. Did you forget to add it?', error)
return t('mail', 'You mentioned an attachment. Did you forget to add it?')
},
})
} finally {
Expand Down

0 comments on commit fd9e7a7

Please sign in to comment.