lock hashed link until further notice

This commit is contained in:
alishaz-polymath 2024-01-11 14:12:54 +04:00
parent bcac078cee
commit afd0d2e0cd
2 changed files with 6 additions and 3 deletions

View File

@ -108,7 +108,8 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
);
};
const { shouldLockDisableProps } = useLockedFieldsManager(eventType, formMethods, t);
const { isChildrenManagedEventType, isManagedEventType, shouldLockDisableProps, shouldLockIndicator } =
useLockedFieldsManager(eventType, formMethods, t);
const eventNamePlaceholder = getEventName({
...eventNameObject,
eventName: formMethods.watch("eventName"),
@ -306,7 +307,9 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
<Info className="ml-1.5 h-4 w-4 cursor-pointer" />
</a>
}
{...shouldLockDisableProps("hashedLinkCheck")}
{...(isChildrenManagedEventType
? { disabled: true, LockedIcon: shouldLockIndicator("hashedLink", false) }
: {})}
description={t("private_link_description", { appName: APP_NAME })}
checked={hashedLinkVisible}
onCheckedChange={(e) => {

View File

@ -139,7 +139,7 @@ const useLockedFieldsManager = (
// eslint-disable-next-line react-hooks/rules-of-hooks
fieldStates[fieldName] = useState(getLockedInitState(fieldName));
}
console.log("fieldStates", fieldStates);
return LockedIndicator(
isManagedEventType,
fieldStates[fieldName],