Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
fix witness page crash
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Mar 7, 2024
1 parent af7744a commit b23a9d2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/common/pages/witnesses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ class WitnessesPage extends BaseComponent<PageProps, State> {
title: _t("witnesses.page-title"),
description: _t("witnesses.page-description")
};

const { global, activeUser, location } = this.props;
let params = location.search.split("=")[1];
const {
Expand All @@ -324,7 +323,8 @@ class WitnessesPage extends BaseComponent<PageProps, State> {
sort,
searchText,
originalWitnesses,
spinner
spinner,
proxyVotes
} = this.state;
const extraWitnesses = witnessVotes.filter((w) => !witnesses.find((y) => y.name === w));
const pageSize = 30;
Expand Down Expand Up @@ -360,7 +360,7 @@ class WitnessesPage extends BaseComponent<PageProps, State> {
return (
<Tr
key={`${row.name}-${row.rank}${i}`}
className={`${this.state.proxyVotes.includes(row.name) ? "voted-by-voter" : ""}`}
className={`${proxyVotes?.includes(row.name) ? "voted-by-voter" : ""}`}
>
<Td className="border p-2">
<div className="witness-rank">
Expand Down Expand Up @@ -447,9 +447,7 @@ class WitnessesPage extends BaseComponent<PageProps, State> {
{witnesses.map((row, i) => {
return (
<span key={`${row.name}${i}`}>
<div
className={`${this.state.proxyVotes.includes(row.name) ? "voted-by-voter" : ""}`}
>
<div className={`${proxyVotes?.includes(row.name) ? "voted-by-voter" : ""}`}>
<WitnessCard
voted={witnessVotes.includes(row.name)}
witness={row.name}
Expand Down

0 comments on commit b23a9d2

Please sign in to comment.