Skip to content

Commit

Permalink
Merge pull request #661 from threshold-network/unmint-details-status-fix
Browse files Browse the repository at this point in the history
UnmintDetails component - redemption status bug fix

There is a bug with `UnmintDetails` component. The **in progress** status occurs
to be false positive when the component is rendered with the redemption data
initially present.
The solution to the issue was to fallback conditional rendering to the
`shouldForceIsProcessCompleted` value which reflects the state when data is
initially present and indicates to force the **completed** state.
  • Loading branch information
michalsmiarowski authored Nov 21, 2023
2 parents e18148c + f22c68d commit 25fd0c8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/pages/tBTC/Bridge/UnmintDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export const UnmintDetails: PageComponent = () => {
as={BridgeProcessDetailsCard}
spacing="4"
// @ts-ignore
isProcessCompleted={shouldDisplaySuccessStep}
isProcessCompleted={
shouldDisplaySuccessStep || shouldForceIsProcessCompleted
}
>
<BridgeLayoutMainSection>
{_isFetching && <BridgeProcessDetailsPageSkeleton />}
Expand All @@ -198,9 +200,13 @@ export const UnmintDetails: PageComponent = () => {
<BridgeProcessCardTitle bridgeProcess="unmint" />
<BridgeProcessCardSubTitle
display="flex"
stepText={shouldDisplaySuccessStep ? "Unminted" : "Unminting"}
stepText={
shouldDisplaySuccessStep || shouldForceIsProcessCompleted
? "Unminted"
: "Unminting"
}
>
{!shouldDisplaySuccessStep && (
{!(shouldDisplaySuccessStep || shouldForceIsProcessCompleted) && (
<Box as="span" ml="2">
{" "}
- In progress...
Expand Down Expand Up @@ -341,7 +347,7 @@ export const UnmintDetails: PageComponent = () => {
</ListItem>
))}
</List>
{!shouldDisplaySuccessStep && (
{!(shouldDisplaySuccessStep || shouldForceIsProcessCompleted) && (
<BridgeProcessResource
title="Minters and Guardians in Optimistic Minting"
subtitle="A phased approach with two main roles: Minters and Guardians."
Expand Down

0 comments on commit 25fd0c8

Please sign in to comment.