fix: show toast error when revoking a NIP 05 identity

merge-requests/3341/head
P. Reis 2025-02-26 20:52:44 -03:00
rodzic 5622458592
commit 011f81d37f
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { revokeName, setBadges as saveBadges } from 'soapbox/actions/admin.ts';
import { deactivateUserModal, deleteUserModal } from 'soapbox/actions/moderation.tsx';
import { HTTPError } from 'soapbox/api/HTTPError.ts';
import { useSuggest, useVerify } from 'soapbox/api/hooks/admin/index.ts';
import { useAccount } from 'soapbox/api/hooks/index.ts';
import Account from 'soapbox/components/account.tsx';
@ -100,7 +101,11 @@ const AccountModerationModal: React.FC<IAccountModerationModal> = ({ onClose, ac
const handleRevokeName = () => {
dispatch(revokeName(account.id))
.then(() => toast.success(intl.formatMessage(messages.revokedName)))
.catch(() => {});
.catch((error) => {
if (error instanceof HTTPError) {
toast.showAlertForError(error);
}
});
};
const handleDelete = () => {