mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
16 lines
420 B
TypeScript
16 lines
420 B
TypeScript
import { appSettingAtom } from '@toeverything/infra';
|
|
import { useAtomValue } from 'jotai/react';
|
|
import { useLayoutEffect } from 'react';
|
|
|
|
import { mixpanel } from './utils';
|
|
|
|
export function Telemetry() {
|
|
const settings = useAtomValue(appSettingAtom);
|
|
useLayoutEffect(() => {
|
|
if (settings.enableTelemetry === false) {
|
|
mixpanel.opt_out_tracking();
|
|
}
|
|
}, [settings.enableTelemetry]);
|
|
return null;
|
|
}
|