refacto(*): rename hostname to custom domain (#10100)

This commit is contained in:
Antoine Moreaux
2025-02-10 16:12:36 +01:00
committed by GitHub
parent 2a0f937899
commit f733307517
51 changed files with 285 additions and 4757 deletions

View File

@ -0,0 +1,28 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useEffect } from 'react';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared';
import { useGetCustomDomainDetailsQuery } from '~/generated/graphql';
export const SettingsCustomDomainEffect = () => {
const { refetch } = useGetCustomDomainDetailsQuery();
const currentWorkspace = useRecoilValue(currentWorkspaceState);
useEffect(() => {
let pollIntervalFn: null | ReturnType<typeof setInterval> = null;
if (isDefined(currentWorkspace?.customDomain)) {
pollIntervalFn = setInterval(async () => {
refetch();
}, 3000);
}
return () => {
if (isDefined(pollIntervalFn)) {
clearInterval(pollIntervalFn);
}
};
}, [currentWorkspace?.customDomain, refetch]);
return <></>;
};