* feat: allows forcing/skipping calendar cache serving Signed-off-by: Omar López <zomars@me.com> * Update features.repository.ts * Added to HNB * type fixes * Update packages/prisma/migrations/20241216000000_add_calendar_cache_serve/migration.sql Co-authored-by: Keith Williams <keithwillcode@gmail.com> * Update packages/prisma/zod-utils.ts Co-authored-by: Keith Williams <keithwillcode@gmail.com> * Update selectedCalendar.ts --------- Signed-off-by: Omar López <zomars@me.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com>
30 lines
754 B
TypeScript
30 lines
754 B
TypeScript
import type { AppFlags } from "@calcom/features/flags/config";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
|
|
const initialData: AppFlags = {
|
|
organizations: false,
|
|
teams: false,
|
|
"calendar-cache": false,
|
|
"calendar-cache-serve": false,
|
|
emails: false,
|
|
insights: false,
|
|
webhooks: false,
|
|
workflows: false,
|
|
"email-verification": false,
|
|
"google-workspace-directory": false,
|
|
"disable-signup": false,
|
|
attributes: false,
|
|
"organizer-request-email-v2": false,
|
|
"domain-wide-delegation": false,
|
|
};
|
|
|
|
if (process.env.NEXT_PUBLIC_IS_E2E) {
|
|
initialData.organizations = true;
|
|
initialData.teams = true;
|
|
}
|
|
|
|
export function useFlags(): Partial<AppFlags> {
|
|
const query = trpc.viewer.features.map.useQuery();
|
|
return query.data ?? initialData;
|
|
}
|