Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-08-04 00:27:35 +0300
committerdartcafe <github@dartcafe.de>2022-08-04 00:27:35 +0300
commit545aab7c33085721596232d2a3f4cce855145da0 (patch)
tree6da0a2d2eeed036b6300e342f0eefd6840a53500 /src/js/components
parent037f2b35b1aaf12fabfa0d6c9e3cb483405037c1 (diff)
skip participant on error
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/components')
-rw-r--r--src/js/components/Export/ExportPoll.vue30
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)