From 8056a5abc33ecb0c15eadc6da83a1f3f7bdc9841 Mon Sep 17 00:00:00 2001 From: nitin <142569587+ehconitin@users.noreply.github.com> Date: Wed, 25 Jun 2025 19:39:22 +0530 Subject: [PATCH] permissions - fix cancel button in create mode (#12870) before - https://github.com/user-attachments/assets/9cbdc57d-40d6-42e3-ad5c-827a6602fbb5 after - https://github.com/user-attachments/assets/76e854eb-d809-4156-a386-b95c62461031 --- .../modules/settings/roles/role/components/SettingsRole.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx index bc643311c..bbf639640 100644 --- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx @@ -110,6 +110,11 @@ export const SettingsRole = ({ roleId, isCreateMode }: SettingsRoleProps) => { const isDirty = !isDeeplyEqual(settingsDraftRole, settingsPersistedRole); const handleCancel = () => { + if (isCreateMode) { + navigateSettings(SettingsPath.Roles); + return; + } + if (isDefined(settingsPersistedRole)) { setSettingsDraftRole(settingsPersistedRole); }