From df504cf2d55ab8280b5f35994f063e14d0117ab7 Mon Sep 17 00:00:00 2001
From: germanocaumo <germanocaumo@gmail.com>
Date: Tue, 8 Jun 2021 13:26:07 +0000
Subject: [PATCH] refactor(quick-poll): Remove unneeded code for poll answers

The answers are already translated in the UI based on type.
---
 .../quick-poll-dropdown/component.jsx         | 35 +------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx
index 76f1e7c5a3..366f7e4b61 100644
--- a/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx
@@ -43,30 +43,7 @@ const propTypes = {
   amIPresenter: PropTypes.bool.isRequired,
 };
 
-const getLocalizedAnswers = (type, intl, pollTypes) => {
-  switch (type) {
-    case pollTypes.TrueFalse:
-      return [
-        intl.formatMessage(intlMessages.trueOptionLabel),
-        intl.formatMessage(intlMessages.falseOptionLabel),
-      ];
-    case pollTypes.YesNo:
-      return [
-        intl.formatMessage(intlMessages.yesOptionLabel),
-        intl.formatMessage(intlMessages.noOptionLabel),
-      ];
-    case pollTypes.YesNoAbstention:
-      return [
-        intl.formatMessage(intlMessages.yesOptionLabel),
-        intl.formatMessage(intlMessages.noOptionLabel),
-        intl.formatMessage(intlMessages.abstentionOptionLabel),
-      ];
-    default:
-      return null;
-  }
-};
-
-const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollTypes) => {
+const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, pollTypes) => {
   const pollItemElements = parsedSlides.map((poll) => {
     let { poll: label, type } = poll;
     let itemLabel = label;
@@ -78,8 +55,6 @@ const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollType
     {
       const { options } = itemLabel;
       itemLabel = options.join('/').replace(/[\n.)]/g, '');
-    } else {
-      answers = getLocalizedAnswers(type, intl, pollTypes);
     }
 
     // removes any whitespace from the label
@@ -150,14 +125,6 @@ class QuickPollDropdown extends Component {
       singlePollType = type;
     }
 
-    if (singlePollType === pollTypes.TrueFalse || 
-        singlePollType === pollTypes.YesNo || 
-        singlePollType === pollTypes.YesNoAbstention) 
-    {
-      answers = getLocalizedAnswers(singlePollType, intl, pollTypes);
-      singlePollType = pollTypes.Custom;
-    }
-
     let btn = (
       <Button
         aria-label={intl.formatMessage(intlMessages.quickPollLabel)}
-- 
GitLab