diff --git a/js/src/forum/components/Poll/PollOption.tsx b/js/src/forum/components/Poll/PollOption.tsx index 73ca58f3..3c32b95e 100644 --- a/js/src/forum/components/Poll/PollOption.tsx +++ b/js/src/forum/components/Poll/PollOption.tsx @@ -50,6 +50,8 @@ export default class PollOption extends Component { } view(): Mithril.Children { + this.voted = this.state.hasVotedFor(this.option); + const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote()); const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100; diff --git a/js/src/forum/components/PollsPage.tsx b/js/src/forum/components/PollsPage.tsx index dac41c7d..9ebf1f2d 100644 --- a/js/src/forum/components/PollsPage.tsx +++ b/js/src/forum/components/PollsPage.tsx @@ -2,7 +2,6 @@ import type Mithril from 'mithril'; import app from 'flarum/forum/app'; import listItems from 'flarum/common/helpers/listItems'; import ItemList from 'flarum/common/utils/ItemList'; -import Page, { IPageAttrs } from 'flarum/common/components/Page'; import IndexPage from 'flarum/forum/components/IndexPage'; import PollList from './Poll/PollList'; import LogInModal from 'flarum/forum/components/LogInModal'; @@ -11,7 +10,6 @@ import PollListState from '../states/PollListState'; import Button from 'flarum/common/components/Button'; import SelectDropdown from 'flarum/common/components/SelectDropdown'; import LoadingIndicator from 'flarum/common/components/LoadingIndicator'; -import PollModel from '../models/Poll'; import PollView from './PollView'; import { AbstractPollPage } from './AbstractPollPage';