diff --git a/src/pages/dao/roles/edit/SafeRolesEditPage.tsx b/src/pages/dao/roles/edit/SafeRolesEditPage.tsx index d991aff74..9793477b8 100644 --- a/src/pages/dao/roles/edit/SafeRolesEditPage.tsx +++ b/src/pages/dao/roles/edit/SafeRolesEditPage.tsx @@ -18,7 +18,7 @@ import { analyticsEvents } from '../../../../insights/analyticsEvents'; import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; import { useDaoInfoStore } from '../../../../store/daoInfo/useDaoInfoStore'; import { useRolesStore } from '../../../../store/roles/useRolesStore'; -import { EditBadgeStatus, RoleFormValues } from '../../../../types/roles'; +import { RoleFormValues } from '../../../../types/roles'; export function SafeRolesEditPage() { useEffect(() => { @@ -29,35 +29,12 @@ export function SafeRolesEditPage() { const { safe } = useDaoInfoStore(); const { addressPrefix } = useNetworkConfig(); - const { values, setFieldValue, touched } = useFormikContext(); + const { values, setFieldValue } = useFormikContext(); const { hatsTree } = useRolesStore(); const navigate = useNavigate(); - function generateRoleProposalTitle({ formValues }: { formValues: RoleFormValues }) { - const filteredHats = formValues.hats.filter(hat => !!hat.editedRole); - const addedHatsCount = filteredHats.filter( - hat => hat.editedRole!.status === EditBadgeStatus.New, - ).length; - const updatedHatsCount = filteredHats.filter( - hat => hat.editedRole!.status === EditBadgeStatus.Updated, - ).length; - const removedHatsCount = filteredHats.filter( - hat => hat.editedRole!.status === EditBadgeStatus.Removed, - ).length; - - const addedHatsText = addedHatsCount > 0 ? t('addedHats', { count: addedHatsCount }) : ''; - - const updatedHatsText = - updatedHatsCount > 0 ? t('updatedHats', { count: updatedHatsCount }) : ''; - - const removedHatsText = - removedHatsCount > 0 ? t('removedHats', { count: removedHatsCount }) : ''; - - return [addedHatsText, updatedHatsText, removedHatsText].filter(Boolean).join('. '); - } - const [hasEditedRoles, setHasEditedRoles] = useState(false); const blocker = useNavigationBlocker({ roleEditPageNavigationBlockerParams: { hasEditedRoles } }); @@ -155,12 +132,6 @@ export function SafeRolesEditPage() {