feat(core): track web-clipper import (#12599)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added tracking for document creation when importing with the clipper tool.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
CatsJuice
2025-05-28 08:34:22 +00:00
parent 2d5b9022fd
commit 793823a9f9
2 changed files with 7 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import {
WorkspacesService,
} from '@affine/core/modules/workspace';
import { useI18n } from '@affine/i18n';
import track from '@affine/track';
import { AllDocsIcon } from '@blocksuite/icons/rc';
import { LiveData, useLiveData, useService } from '@toeverything/infra';
import { cssVar } from '@toeverything/theme';
@@ -98,6 +99,7 @@ export const Component = () => {
const handleSuccess = useCallback(() => {
const arg = { type: 'affine-clipper:import:success' };
const port = port$.value;
track.clipper.$.$.createDoc();
if (port) {
port.postMessage(arg);
} else {