MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / registerAnalyticsHandlers

Function registerAnalyticsHandlers

apps/desktop/main/analytics.ts:24–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22}
23
24export function registerAnalyticsHandlers(): void {
25 ipcMain.handle('analytics:getEnabled', () => {
26 return getService()?.getEnabled() ?? true
27 })
28
29 ipcMain.handle('analytics:setEnabled', (_, enabled: boolean) => {
30 getService()?.setEnabled(enabled)
31 return { success: true }
32 })
33
34 ipcMain.handle('analytics:trackDailyActive', (_, locale: string) => {
35 getService()
36 ?.trackDailyActive({ platform: 'desktop', locale })
37 .catch((e) => console.error('[Analytics] Failed to report daily active:', e))
38 })
39}
40
41export function trackAppEvent(eventName: string, properties?: Record<string, string | number>): void {
42 getService()

Callers 1

mainIpcMainFunction · 0.90

Calls 5

getServiceFunction · 0.85
getEnabledMethod · 0.80
setEnabledMethod · 0.65
trackDailyActiveMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected