Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
fix: slot number wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
sotatek-huytran committed Jul 15, 2024
1 parent 2e96a55 commit 1eb1686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/commons/DetailView/DetailViewEpoch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ const DetailViewEpoch: React.FC<DetailViewEpochProps> = ({ epochNo, handleClose,
);
}

const slot = data.no === currentEpoch?.no ? currentEpoch.slot : data.maxSlot || MAX_SLOT_EPOCH;
const slot =
data.no === currentEpoch?.no && data.status !== "SYNCING" ? currentEpoch.slot : data.maxSlot || MAX_SLOT_EPOCH;

const progress = data.no === currentEpoch?.no ? (currentEpoch?.syncingProgress || 0) * 100 : 100;
return (
Expand Down
4 changes: 3 additions & 1 deletion src/components/commons/Epoch/FirstEpoch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export default function FirstEpoch({ data: currentEpochData, onClick }: IProps)
),
value: (
<Content data-testid="epoch.firstEpoch.slotValue">
{moment(currentEpochData.endTime).diff(moment()) >= 0 ? currentEpoch?.slot : MAX_SLOT_EPOCH}
{moment(formatDateTimeLocal(currentEpochData.endTime)).diff(moment()) >= 0
? currentEpoch?.slot
: MAX_SLOT_EPOCH}
<SubContent>/{MAX_SLOT_EPOCH}</SubContent>
</Content>
)
Expand Down

0 comments on commit 1eb1686

Please sign in to comment.