chore: added telemetry key refrences

This commit is contained in:
LAKHAN BAHETI 2024-03-12 12:52:37 +05:30
parent 2a51e17210
commit 5b2e271f7c
3 changed files with 6 additions and 10 deletions

View File

@ -12,6 +12,7 @@ export interface IInstance {
version: string; version: string;
last_checked_at: string; last_checked_at: string;
namespace: string | null; namespace: string | null;
is_telemetry_anonymous: boolean;
is_telemetry_enabled: boolean; is_telemetry_enabled: boolean;
is_support_required: boolean; is_support_required: boolean;
created_by: string | null; created_by: string | null;

View File

@ -36,6 +36,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
const { currentWorkspace, workspaces } = useWorkspace(); const { currentWorkspace, workspaces } = useWorkspace();
const { const {
config: { envConfig }, config: { envConfig },
instance: { instance },
} = useApplication(); } = useApplication();
// themes // themes
const { resolvedTheme } = useTheme(); const { resolvedTheme } = useTheme();
@ -51,6 +52,8 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
user={currentUser} user={currentUser}
currentWorkspaceId={currentWorkspace?.id} currentWorkspaceId={currentWorkspace?.id}
workspaceIds={Object.keys(workspaces)} workspaceIds={Object.keys(workspaces)}
isCloud={!instance?.is_telemetry_anonymous || false}
telemetryEnabled={instance?.is_telemetry_enabled || false}
posthogAPIKey={envConfig?.posthog_api_key || null} posthogAPIKey={envConfig?.posthog_api_key || null}
posthogHost={envConfig?.posthog_host || null} posthogHost={envConfig?.posthog_host || null}
> >

View File

@ -19,16 +19,8 @@ export interface IPosthogWrapper {
} }
const PostHogProvider: FC<IPosthogWrapper> = (props) => { const PostHogProvider: FC<IPosthogWrapper> = (props) => {
const { const { children, user, workspaceIds, currentWorkspaceId, posthogAPIKey, posthogHost, isCloud, telemetryEnabled } =
children, props;
user,
workspaceIds,
currentWorkspaceId,
posthogAPIKey,
posthogHost,
isCloud = true,
telemetryEnabled = false,
} = props;
// states // states
const [lastWorkspaceId, setLastWorkspaceId] = useState(currentWorkspaceId); const [lastWorkspaceId, setLastWorkspaceId] = useState(currentWorkspaceId);
// router // router