()
| 7 | let _service: AnalyticsService | null = null |
| 8 | |
| 9 | function 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 | |
| 18 | export function initAnalytics(): void { |
| 19 | // Service is initialized lazily; no-op here unless we want eager validation. |
no test coverage detected