diff options
author | dartcafe <github@dartcafe.de> | 2020-11-14 01:48:41 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-11-19 10:20:51 +0300 |
commit | c85953b4c7cdc0ab2a7bb51b504d14db248dba22 (patch) | |
tree | bb6cb0898b228d26230ac06893487e1dfe65bcfc /src/js/components/SideBar | |
parent | d67353002d36861c1719d5f0be51461ff5043f8d (diff) |
progress, fixes and optimizations
Diffstat (limited to 'src/js/components/SideBar')
-rw-r--r-- | src/js/components/SideBar/SideBarTabShare.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/js/components/SideBar/SideBarTabShare.vue b/src/js/components/SideBar/SideBarTabShare.vue index ffa036c6..4bdba555 100644 --- a/src/js/components/SideBar/SideBarTabShare.vue +++ b/src/js/components/SideBar/SideBarTabShare.vue @@ -192,13 +192,17 @@ export default { sendInvitation(share) { this.$store.dispatch('poll/shares/sendInvitation', { share: share }) .then((response) => { - response.data.sentResult.sentMails.forEach((item) => { - showSuccess(t('polls', 'Invitation sent to {name}', { name: item.displayName })) - }) - response.data.sentResult.abortedMails.forEach((item) => { - console.error('Mail could not be sent!', { recipient: item }) - showError(t('polls', 'Error sending invitation to {name}', { name: item.dispalyName })) - }) + if ('sentResult.sentMails' in response.data) { + response.data.sentResult.sentMails.forEach((item) => { + showSuccess(t('polls', 'Invitation sent to {name}', { name: item.displayName })) + }) + } + if ('sentResult.abortedMails' in response.data) { + response.data.sentResult.abortedMails.forEach((item) => { + console.error('Mail could not be sent!', { recipient: item }) + showError(t('polls', 'Error sending invitation to {name}', { name: item.dispalyName })) + }) + } }) }, |