Skip to content

Commit

Permalink
Merge pull request #1599 from ecency/bugfix/polls
Browse files Browse the repository at this point in the history
Fixed polls voters showing
  • Loading branch information
feruzm authored May 5, 2024
2 parents 4067c98 + 5223856 commit dc344d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/features/polls/components/poll-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export function PollWidget({ poll, isReadOnly, entry }: Props) {
const endTimeFullDate = useMemo(() => format(poll.endTime, "dd.MM.yyyy HH:mm"), [poll.endTime]);
const isFinished = useMemo(() => isBefore(poll.endTime, new Date()), [poll.endTime]);
const showViewVotes = useMemo(
() => !poll.hideVotes && !resultsMode,
[poll.hideVotes, resultsMode]
() => (!poll.hideVotes && !resultsMode) || activeUser?.username === entry?.author,
[poll.hideVotes, resultsMode, activeUser?.username, entry?.author]
);
const showChangeVote = useMemo(
() => poll.voteChange && resultsMode && pollDetails.data?.status === "Active",
Expand Down Expand Up @@ -178,7 +178,7 @@ export function PollWidget({ poll, isReadOnly, entry }: Props) {
{_t(isVoting ? "polls.voting" : "polls.vote")}
</Button>
)}
{!pollDetails.data?.poll_trx_id && !isReadOnly && (
{pollDetails.data && !pollDetails.data.poll_trx_id && !isReadOnly && (
<Button size="sm" disabled={true}>
{_t("polls.creating-in-progress")}
</Button>
Expand Down

0 comments on commit dc344d9

Please sign in to comment.