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;
last_checked_at: string;
namespace: string | null;
is_telemetry_anonymous: boolean;
is_telemetry_enabled: boolean;
is_support_required: boolean;
created_by: string | null;

View File

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

View File

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