diff --git a/bigbluebutton-html5/imports/ui/components/poll/component.jsx b/bigbluebutton-html5/imports/ui/components/poll/component.jsx index cf93995c6021d7a0d82dfd642f08a961f928cb4b..f8aad01e500f644bc111412a29de1186090644fe 100644 --- a/bigbluebutton-html5/imports/ui/components/poll/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/poll/component.jsx @@ -89,13 +89,21 @@ class Poll extends Component { this.renderQuickPollBtns = this.renderQuickPollBtns.bind(this); this.renderInputFields = this.renderInputFields.bind(this); this.validateInputField = this.validateInputField.bind(this); + this.nonPresenterRedirect = this.nonPresenterRedirect.bind(this); this.getInputFields = this.getInputFields.bind(this); } + componentWillMount() { + this.nonPresenterRedirect(); + } + componentDidUpdate(prevProps, prevState) { - const { currentUser, router } = this.props; + this.nonPresenterRedirect(); + } - if (!currentUser.presenter) router.push('/users'); + nonPresenterRedirect() { + const { currentUser, router } = this.props; + if (!currentUser.presenter) return router.push('/users'); } getInputFields() {