Integrate Aptabase analytics via a Tauri plugin and add a privacy notice flow plus a settings dialog to control whether anonymous usage events are sent. The app now tracks key user actions while ensuring analytics never blocks core Git operations. - Add analytics tracking helper and Aptabase plugin wiring - Persist analytics consent in localStorage and gate tracking - Introduce notice and settings dialogs, plus new event calls
13 lines
418 B
TypeScript
13 lines
418 B
TypeScript
import { invoke } from "@tauri-apps/api/core";
|
|
|
|
export type AnalyticsEventProperties = Record<string, string | number>;
|
|
|
|
export function trackAnalyticsEvent(name: string, props?: AnalyticsEventProperties) {
|
|
void invoke("plugin:aptabase|track_event", {
|
|
name,
|
|
props: props && Object.keys(props).length > 0 ? props : undefined,
|
|
}).catch(() => {
|
|
// Analytics must never interrupt the Git workflow.
|
|
});
|
|
}
|