Skip to content
Snippets Groups Projects
Commit 0be7c6c9 authored by germanocaumo's avatar germanocaumo
Browse files

fix(poll): fix client crash with A-F as options and quick-poll type

parent 96474f2c
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,6 @@ const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollType ...@@ -80,7 +80,6 @@ const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollType
itemLabel = options.join('/').replace(/[\n.)]/g, ''); itemLabel = options.join('/').replace(/[\n.)]/g, '');
} else { } else {
answers = getLocalizedAnswers(type, intl, pollTypes); answers = getLocalizedAnswers(type, intl, pollTypes);
type = pollTypes.Custom;
} }
// removes any whitespace from the label // removes any whitespace from the label
......
...@@ -95,7 +95,9 @@ const getPollResultsText = (isDefaultPoll, answers, numRespondents, intl) => { ...@@ -95,7 +95,9 @@ const getPollResultsText = (isDefaultPoll, answers, numRespondents, intl) => {
const pctBars = "|".repeat(pct * MAX_POLL_RESULT_BARS / 100); const pctBars = "|".repeat(pct * MAX_POLL_RESULT_BARS / 100);
const pctFotmatted = `${Number.isNaN(pct) ? 0 : pct}%`; const pctFotmatted = `${Number.isNaN(pct) ? 0 : pct}%`;
if (isDefaultPoll) { if (isDefaultPoll) {
const translatedKey = intl.formatMessage(pollAnswerIds[item.key.toLowerCase()]); const translatedKey = pollAnswerIds[item.key.toLowerCase()]
? intl.formatMessage(pollAnswerIds[item.key.toLowerCase()])
: item.key;
resultString += `${translatedKey}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`; resultString += `${translatedKey}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`;
} else { } else {
resultString += `${item.id+1}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`; resultString += `${item.id+1}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment