Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions src/components/AddressBlockedModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ExclamationCircleIcon, LogoutIcon, RefreshIcon } from '@heroicons/react/outline';
import { Trans } from '@lingui/macro';
import { Box, Button, SvgIcon, Typography } from '@mui/material';
import { useRootStore } from 'src/store/root';
import { useShallow } from 'zustand/react/shallow';
Comment thread
AGMASO marked this conversation as resolved.
Outdated

import { BasicModal } from './primitives/BasicModal';

Expand All @@ -19,7 +21,17 @@ export const AddressBlockedModal = ({
}: AddressBlockedProps) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
const setOpen = (_value: boolean) => {}; // ignore, we want the modal to not be dismissable
const [setFeedbackOpen, setSupportPrefillMessage] = useRootStore(
useShallow((state) => [state.setFeedbackOpen, state.setSupportPrefillMessage])
);
const handleGetSupport = () => {
const walletAddress = address ? address : 'Address not available';
Comment thread
AGMASO marked this conversation as resolved.
const template = `My wallet seems to be blocked:\n\n"${walletAddress}"`;

setSupportPrefillMessage(template);
setFeedbackOpen(true);
close();
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The close() function is called but not defined. Unlike other modals in the codebase (such as Error.tsx), this component doesn't use the useModalContext hook to obtain the close function. Since AddressBlockedModal is designed to be non-dismissable (as indicated by the comment on line 23), calling close() here appears to be a copy-paste error from Error.tsx. This will cause a runtime error when the Get Support button is clicked. Consider removing the close() call, as the modal should remain open when the support feedback dialog opens.

Suggested change
close();

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

close() is called in handleGetSupport, but there is no close in scope (no prop and no useModalContext() hook), so this will fail to compile. Either import/use useModalContext (like TxErrorView does) and call its close, or remove the call if the blocked modal is intended to stay open while the Support modal opens.

Suggested change
close();

Copilot uses AI. Check for mistakes.
};
return (
<BasicModal open={true} withCloseButton={false} setOpen={setOpen}>
<Box
Expand Down Expand Up @@ -48,6 +60,10 @@ export const AddressBlockedModal = ({
<Trans>Refresh</Trans>
</Button>
)}

<Button variant="outlined" onClick={handleGetSupport} size="small">
<Trans>Get support</Trans>
</Button>
<Button variant="contained" onClick={onDisconnectWallet}>
<SvgIcon fontSize="small" sx={{ mx: 1 }}>
<LogoutIcon />
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ msgstr "Reactivate cooldown period to unstake {0} {stakedToken}"
msgid "Migrate to v3"
msgstr "Migrate to v3"

#: src/components/AddressBlockedModal.tsx
#: src/components/transactions/FlowCommons/Error.tsx
msgid "Get support"
msgstr "Get support"
Expand Down
Loading