diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index 55f7d49f1..479775989 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -265,7 +265,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R label: contentTypeMapped?.[otherCmsTitle] ?? `Select ${isContentType ? 'Content Type' : 'Global Field'} from Existing Stack`, value: contentTypeMapped?.[otherCmsTitle] ?? `Select ${isContentType ? 'Content Type' : 'Global Field'} from Existing Stack`, }); - const [otherCmsUid, setOtherCmsUid] = useState(contentTypes[0]?.otherCmsUid); + const [otherCmsUid, setOtherCmsUid] = useState(contentTypes?.[0]?.otherCmsUid); const [active, setActive] = useState(0); @@ -1521,7 +1521,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R isDisabled: true } : (OptionsForRow?.length === 0 || (OptionsForRow?.length > 0 && OptionsForRow?.every((item)=>item?.isDisabled) - && (!existingField[data?.uid] || ! updatedExstingField[data?.uid] ) ) || (OptionsForRow?.length > 0 && data?.contentstackFieldType === "dropdown")) + && (!existingField[data?.uid]?.label || ! updatedExstingField[data?.uid]?.label ) ) || (OptionsForRow?.length > 0 && data?.contentstackFieldType === "dropdown")) ? { label: Fields[data?.contentstackFieldType]?.label ?? 'No Option', value: Fields[data?.contentstackFieldType]?.label ?? 'No Option', @@ -2423,4 +2423,4 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R }); ContentMapper.displayName = 'ContentMapper'; -export default ContentMapper; \ No newline at end of file +export default ContentMapper;