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

Function getService

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

Source from the content-addressed store, hash-verified

7let _service: AnalyticsService | null = null
8
9function getService(): AnalyticsService | null {
10 if (!APTABASE_APP_KEY) return null
11 if (!_service) {
12 const systemDir = getSystemDataDir()
13 _service = new AnalyticsService(systemDir, APTABASE_APP_KEY, app.getVersion())
14 }
15 return _service
16}
17
18export function initAnalytics(): void {
19 // Service is initialized lazily; no-op here unless we want eager validation.

Callers 3

initAnalyticsFunction · 0.85
trackAppEventFunction · 0.85

Calls 2

getSystemDataDirFunction · 0.90
getVersionMethod · 0.65

Tested by

no test coverage detected