Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ function BitcoinRedeemedStateAlert({ swap }: { swap: GetSwapInfoResponseExt }) {
"If this step fails, you can manually redeem your funds",
]}
/>
<SwapMoneroRecoveryButton swap={swap} size="small" variant="contained" />
<SwapMoneroRecoveryButton swap={swap} size="small" variant="contained">
Display Monero Recovery Keys
</SwapMoneroRecoveryButton>
</Box>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function MoneroRecoveryKeysDialog({

export function SwapMoneroRecoveryButton({
swap,
children,
...props
}: { swap: GetSwapInfoResponseExt } & ButtonProps) {
const isRecoverable =
Expand All @@ -127,7 +128,7 @@ export function SwapMoneroRecoveryButton({
}}
{...props}
>
Display Monero Recovery Keys
{children}
</PromiseInvokeButton>
<MoneroRecoveryKeysDialog {...swap} />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
import { Box } from "@mui/material";
import { SwapMoneroRecoveryButton } from "renderer/components/pages/history/table/SwapMoneroRecoveryButton";
import { useActiveSwapInfo } from "store/hooks";
import CircularProgressWithSubtitle from "../components/CircularProgressWithSubtitle";

export default function ConstructingMoneroRedeemPage() {
const swap = useActiveSwapInfo();

return (
<CircularProgressWithSubtitle description="Constructing the Monero redeem transaction" />
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
gap: 1,
}}
>
<CircularProgressWithSubtitle description="Constructing the Monero redeem transaction" />
{swap && (
<SwapMoneroRecoveryButton
swap={swap}
variant="text"
size="small"
sx={(theme) => ({ color: theme.palette.text.secondary })}
>
Redeem manually
</SwapMoneroRecoveryButton>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate recovery modals open

Medium Severity

Each SwapMoneroRecoveryButton mounts its own MoneroRecoveryKeysDialog, which opens when shared moneroRecovery state matches the swap. With the new in-progress buttons plus the existing alert button, one successful fetch can render two open dialogs for the same keys.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dcd7e59. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@binarybaron Is this a problem?

</Box>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
import { Box } from "@mui/material";
import { SwapMoneroRecoveryButton } from "renderer/components/pages/history/table/SwapMoneroRecoveryButton";
import { useActiveSwapInfo } from "store/hooks";
import CircularProgressWithSubtitle from "../components/CircularProgressWithSubtitle";

export default function PublishingMoneroRedeemPage() {
const swap = useActiveSwapInfo();

return (
<CircularProgressWithSubtitle description="Publishing the Monero redeem transaction" />
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
gap: 1,
}}
>
<CircularProgressWithSubtitle description="Publishing the Monero redeem transaction" />
{swap && (
<SwapMoneroRecoveryButton
swap={swap}
variant="text"
size="small"
sx={(theme) => ({ color: theme.palette.text.secondary })}
>
Redeem manually
</SwapMoneroRecoveryButton>
)}
</Box>
);
}
Loading