Skip to content

Commit

Permalink
better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
boudra committed Feb 16, 2024
1 parent d92254c commit aab4b8f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/round-manager/src/features/round/ViewRoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ import moment from "moment";
import ApplicationsToApproveReject from "./ApplicationsToApproveReject";
import ApplicationsToReview from "./ApplicationsToReview";

export const isDirectRound = (round: Round) => {
return (
round && round.payoutStrategy.strategyName?.toLowerCase().includes("direct")
);
};
const ROUND_PAYOUT_DIRECT = "DIRECT";
const ROUND_PAYOUT_MERKLE = "MERKLE";

export const isDirectRound = (round: Round) =>
round && round.payoutStrategy.strategyName === ROUND_PAYOUT_DIRECT;

export default function ViewRoundPage() {
datadogLogs.logger.info("====> Route: /round/:id");
Expand Down Expand Up @@ -313,7 +313,10 @@ export default function ViewRoundPage() {
<Tab.Panels className="flex-grow ml-6">
<Tab.Panel>
<GrantApplications
isDirectRound={isDirectRound(round)}
isDirectRound={
round.payoutStrategy.strategyName ==
ROUND_PAYOUT_DIRECT
}
applications={applications}
isRoundsFetched={isRoundFetched}
fetchRoundStatus={fetchRoundStatus}
Expand Down Expand Up @@ -637,8 +640,10 @@ export function RoundBadgeStatus({ round }: { round: Round }) {
const now = moment();

if (
(!isDirectRound(round) && now.isBefore(applicationEnds)) ||
(isDirectRound(round) && now.isBefore(roundEnds))
(round.payoutStrategy.strategyName == ROUND_PAYOUT_MERKLE &&
now.isBefore(applicationEnds)) ||
(round.payoutStrategy.strategyName == ROUND_PAYOUT_DIRECT &&
now.isBefore(roundEnds))
) {
return (
<div
Expand Down

0 comments on commit aab4b8f

Please sign in to comment.