File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 4
4
PROMPT_SERVICE as AI_PROMPT_SERVICE
5
5
} from '$lib/ai/promptService' ;
6
6
import { AIService , AI_SERVICE } from '$lib/ai/service' ;
7
- import { initAnalyticsIfEnabled } from '$lib/analytics/analytics' ;
8
7
import { EVENT_CONTEXT , EventContext } from '$lib/analytics/eventContext' ;
9
8
import { POSTHOG_WRAPPER , PostHogWrapper } from '$lib/analytics/posthog' ;
10
9
import { type IBackend } from '$lib/backend' ;
@@ -107,7 +106,6 @@ export function initDependencies(args: {
107
106
108
107
const eventContext = new EventContext ( ) ;
109
108
const posthog = new PostHogWrapper ( settingsService , backend , eventContext ) ;
110
- initAnalyticsIfEnabled ( appSettings , posthog ) ;
111
109
112
110
// ============================================================================
113
111
// AUTHENTICATION & SECURITY
Original file line number Diff line number Diff line change 13
13
import SwitchThemeMenuAction from ' $components/SwitchThemeMenuAction.svelte' ;
14
14
import ToastController from ' $components/ToastController.svelte' ;
15
15
import ZoomInOutMenuAction from ' $components/ZoomInOutMenuAction.svelte' ;
16
+ import { initAnalyticsIfEnabled } from ' $lib/analytics/analytics' ;
16
17
import { POSTHOG_WRAPPER } from ' $lib/analytics/posthog' ;
17
18
import { initDependencies } from ' $lib/bootstrap/deps' ;
19
+ import { APP_SETTINGS } from ' $lib/config/appSettings' ;
18
20
import { SETTINGS_SERVICE } from ' $lib/config/appSettingsV2' ;
19
21
import { ircEnabled , ircServer } from ' $lib/config/uiFeatureFlags' ;
20
22
import { GITHUB_CLIENT } from ' $lib/forge/github/githubClient' ;
45
47
initDependencies (data );
46
48
47
49
const clientState = inject (CLIENT_STATE );
50
+ const appSettings = inject (APP_SETTINGS );
51
+ const posthog = inject (POSTHOG_WRAPPER );
52
+
48
53
clientState .initPersist ();
54
+ initAnalyticsIfEnabled (appSettings , posthog );
49
55
50
56
// =============================================================================
51
57
// CORE REACTIVE STATE & EFFECTS
79
85
// ANALYTICS & NAVIGATION
80
86
// =============================================================================
81
87
82
- // Analytics for single page app navigation
83
- const posthog = inject (POSTHOG_WRAPPER );
84
88
if (browser ) {
85
89
beforeNavigate (() => posthog .capture (' $pageleave' ));
86
90
afterNavigate (() => posthog .capture (' $pageview' ));
You can’t perform that action at this time.
0 commit comments