mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
feat(core): improve mixpanel (#7652)
move @affine/core/utils/mixpanel -> @affine/core/mixpanel now you can debug mixpanel on browser devtool 
This commit is contained in:
@@ -9,7 +9,7 @@ export const Empty = ({
|
||||
}: {
|
||||
onDrop: (data: DropTargetDropEvent<AffineDNDData>) => void;
|
||||
}) => {
|
||||
const { dropTargetRef } = useDropTarget(
|
||||
const { dropTargetRef } = useDropTarget<AffineDNDData>(
|
||||
() => ({
|
||||
onDrop,
|
||||
}),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { mixpanel } from '@affine/core/mixpanel';
|
||||
import type { QuotaQuery } from '@affine/graphql';
|
||||
import type { WorkspaceScope } from '@toeverything/infra';
|
||||
import {
|
||||
@@ -31,20 +31,6 @@ export class TelemetryService extends Service {
|
||||
}
|
||||
|
||||
onApplicationStart() {
|
||||
if (process.env.MIXPANEL_TOKEN) {
|
||||
mixpanel.init(process.env.MIXPANEL_TOKEN || '', {
|
||||
track_pageview: true,
|
||||
persistence: 'localStorage',
|
||||
api_host: 'https://telemetry.affine.run',
|
||||
});
|
||||
mixpanel.register({
|
||||
appVersion: runtimeConfig.appVersion,
|
||||
environment: runtimeConfig.appBuildType,
|
||||
editorVersion: runtimeConfig.editorVersion,
|
||||
isSelfHosted: Boolean(runtimeConfig.isSelfHosted),
|
||||
isDesktop: environment.isDesktop,
|
||||
});
|
||||
}
|
||||
const account = this.auth.session.account$.value;
|
||||
this.updateIdentity(account);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { mixpanel } from '@affine/core/mixpanel';
|
||||
import { createEvent, Service } from '@toeverything/infra';
|
||||
import { combineLatest, distinctUntilChanged, map, skip } from 'rxjs';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user