Skip to content

Commit 00d4a30

Browse files
committed
fix: restore telemetry in App.tsx
1 parent 8749139 commit 00d4a30

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/frontend/src/App.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import React, { useState, useEffect } from "react";
22
import { Excalidraw, MainMenu, Footer } from "@atyrode/excalidraw";
33
import type { ExcalidrawImperativeAPI, AppState } from "@atyrode/excalidraw/types";
44
import type { ExcalidrawEmbeddableElement, NonDeleted } from "@atyrode/excalidraw/element/types";
@@ -7,6 +7,7 @@ import type { ExcalidrawEmbeddableElement, NonDeleted } from "@atyrode/excalidra
77
import { useAuthStatus } from "./hooks/useAuthStatus";
88
import { usePadTabs } from "./hooks/usePadTabs";
99
import { useCallbackRefState } from "./hooks/useCallbackRefState";
10+
import { useAppConfig } from "./hooks/useAppConfig";
1011

1112
// Components
1213
import DiscordButton from './ui/DiscordButton';
@@ -22,6 +23,7 @@ import Tabs from "./ui/Tabs";
2223
import { INITIAL_APP_DATA, HIDDEN_UI_ELEMENTS } from "./constants";
2324

2425
export default function App() {
26+
const { config, configError } = useAppConfig();
2527
const { isAuthenticated, isLoading: isLoadingAuth, user } = useAuthStatus();
2628

2729
const {
@@ -49,16 +51,16 @@ export default function App() {
4951
lockEmbeddables(excalidrawAPI?.getAppState());
5052
};
5153

52-
// useEffect(() => {
53-
// if (appConfig?.posthogKey && appConfig?.posthogHost) {
54-
// initializePostHog({
55-
// posthogKey: appConfig.posthogKey,
56-
// posthogHost: appConfig.posthogHost,
57-
// });
58-
// } else if (configError) {
59-
// console.error('[pad.ws] Failed to load app config:', configError);
60-
// }
61-
// }, [appConfig, configError]);
54+
useEffect(() => {
55+
if (config?.posthogKey && config?.posthogHost) {
56+
initializePostHog({
57+
posthogKey: config.posthogKey,
58+
posthogHost: config.posthogHost,
59+
});
60+
} else if (configError) {
61+
console.error('[pad.ws] Failed to load app config:', configError);
62+
}
63+
}, [config, configError]);
6264

6365
return (
6466
<>

0 commit comments

Comments
 (0)