diff options
author | dartcafe <github@dartcafe.de> | 2022-08-04 00:27:35 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2022-08-04 00:27:35 +0300 |
commit | 545aab7c33085721596232d2a3f4cce855145da0 (patch) | |
tree | 6da0a2d2eeed036b6300e342f0eefd6840a53500 /src | |
parent | 037f2b35b1aaf12fabfa0d6c9e3cb483405037c1 (diff) |
skip participant on error
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/js/components/Export/ExportPoll.vue | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/js/components/Export/ExportPoll.vue b/src/js/components/Export/ExportPoll.vue index 2adb0ca7..a7125bdb 100644 --- a/src/js/components/Export/ExportPoll.vue +++ b/src/js/components/Export/ExportPoll.vue @@ -176,21 +176,25 @@ export default { addVotesArray(style) {
this.participants.forEach((participant) => {
const votesLine = [participant.displayName]
- if (this.isOwner) {
- votesLine.push(this.emailAddresses.find((item) => item.displayName === participant.displayName).emailAddress)
- }
-
- this.options.list.forEach((option, i) => {
- if (style === 'symbols') {
- votesLine.push(this.getVote({ userId: participant.userId, option }).answerSymbol ?? '❌')
- } else if (style === 'raw') {
- votesLine.push(this.getVote({ userId: participant.userId, option }).answer)
- } else {
- votesLine.push(this.getVote({ userId: participant.userId, option }).answerTranslated ?? t('polls', 'No'))
+ try {
+ if (this.isOwner) {
+ votesLine.push(this.emailAddresses.find((item) => item.displayName === participant.displayName).emailAddress)
}
- })
- this.sheetData.push(votesLine)
+ this.options.list.forEach((option, i) => {
+ if (style === 'symbols') {
+ votesLine.push(this.getVote({ userId: participant.userId, option }).answerSymbol ?? '❌')
+ } else if (style === 'raw') {
+ votesLine.push(this.getVote({ userId: participant.userId, option }).answer)
+ } else {
+ votesLine.push(this.getVote({ userId: participant.userId, option }).answerTranslated ?? t('polls', 'No'))
+ }
+ })
+
+ this.sheetData.push(votesLine)
+ } catch (e) {
+ // just skip this participant
+ }
})
const workSheet = xlsxUtils.aoa_to_sheet(this.sheetData)
|