Files
calendar/packages/features/flags/hooks/index.ts
T
Somay ChauhanandGitHub a45d77de51 fix: initialized flags on event-types page (#13469)
* fix: initialized flags on event-types page

* changes

* chore: removed `managed-event-types` flag as no longer needed

* revert: `20230404202721_add_feature_flag_managed_event_types` migration
2024-02-02 15:35:00 +00:00

13 lines
389 B
TypeScript

import type { AppFlags } from "@calcom/features/flags/config";
import { trpc } from "@calcom/trpc/react";
const initialData: Partial<AppFlags> = process.env.NEXT_PUBLIC_IS_E2E
? { organizations: true, teams: true }
: {};
export function useFlags(): Partial<AppFlags> {
const query = trpc.viewer.features.map.useQuery(undefined, {
initialData,
});
return query.data ?? {};
}