Files
twenty_crm/packages/twenty-front/src/modules/domain-manager/hooks/useReadWorkspaceUrlFromCurrentLocation.ts
Antoine Moreaux 68183b7c85 feat(): enable custom domain usage (#9911)
# Content
- Introduce the `workspaceUrls` property. It contains two
sub-properties: `customUrl, subdomainUrl`. These endpoints are used to
access the workspace. Even if the `workspaceUrls` is invalid for
multiple reasons, the `subdomainUrl` remains valid.
- Introduce `ResolveField` workspaceEndpoints to avoid unnecessary URL
computation on the frontend part.
- Add a `forceSubdomainUrl` to avoid custom URL using a query parameter
2025-02-07 14:34:26 +01:00

12 lines
352 B
TypeScript

import { useIsCurrentLocationOnAWorkspace } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspace';
export const useReadWorkspaceUrlFromCurrentLocation = () => {
const { isOnAWorkspace } = useIsCurrentLocationOnAWorkspace();
return {
currentLocationHostname: isOnAWorkspace
? window.location.hostname
: undefined,
};
};