Skip to content

Commit

Permalink
Remove navigateBack
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed Aug 7, 2024
1 parent acb1811 commit 72722d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const useGetAvailableFieldsForKanban = () => {
navigate(
`/settings/objects/${getObjectSlug(
objectMetadataItem,
)}/new-field/step-2?fieldType=${
FieldMetadataType.Select
}&navigateBack=true`,
)}/new-field/step-2?fieldType=${FieldMetadataType.Select}`,
);
} else {
navigate(`/settings/objects`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const SettingsObjectNewFieldStep2 = () => {
const { objectSlug = '' } = useParams();
const [searchParams] = useSearchParams();
const fieldType = searchParams.get('fieldType');
const navigateBack = searchParams.get('navigateBack');
const { enqueueSnackBar } = useSnackBar();

const { findActiveObjectMetadataItemBySlug } =
Expand Down Expand Up @@ -148,11 +147,7 @@ export const SettingsObjectNewFieldStep2 = () => {
});
}

if (navigateBack?.toLowerCase() === 'true') {
navigate(-1);
} else {
navigate(`/settings/objects/${objectSlug}`);
}
navigate(`/settings/objects/${objectSlug}`);

// TODO: fix optimistic update logic
// Forcing a refetch for now but it's not ideal
Expand Down Expand Up @@ -198,8 +193,7 @@ export const SettingsObjectNewFieldStep2 = () => {
isSaveDisabled={!canSave}
isCancelDisabled={isSubmitting}
onCancel={() => {
if (navigateBack?.toLowerCase() === 'true') navigate(-1);
else navigate(`/settings/objects/${objectSlug}`);
navigate(`/settings/objects/${objectSlug}`);
}}
onSave={formConfig.handleSubmit(handleSave)}
/>
Expand Down

0 comments on commit 72722d9

Please sign in to comment.