fix(editor): update embed iframe block event tracker (#11736)

Close [BS-3151](https://linear.app/affine-design/issue/BS-3151/埋一下-reload-link-成功失败)
This commit is contained in:
donteatfriedrice
2025-04-16 09:53:38 +00:00
parent 16f7be7f0b
commit 022e5f2c93
8 changed files with 31 additions and 16 deletions
@@ -209,9 +209,9 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
});
};
private readonly _handleRetry = (e: MouseEvent) => {
private readonly _handleRetry = async (e: MouseEvent) => {
e.stopPropagation();
this.onRetry();
const success = await this.onRetry();
// track retry event
this.telemetryService?.track('ReloadLink', {
@@ -220,6 +220,7 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
segment: 'editor',
module: 'embed block',
control: 'reload button',
result: success ? 'success' : 'failure',
});
};
@@ -301,7 +302,7 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
accessor error: Error | null = null;
@property({ attribute: false })
accessor onRetry!: () => void;
accessor onRetry!: () => Promise<boolean>;
@property({ attribute: false })
accessor model!: EmbedIframeBlockModel;
@@ -78,7 +78,7 @@ export class EmbedIframeLinkEditPopup extends SignalWatcher(
segment: 'editor',
module: 'embed block',
control: 'edit button',
other: status,
result: status,
});
}
@@ -228,7 +228,7 @@ export class EmbedIframeLinkInputPopup extends EmbedIframeLinkInputBase {
segment: this.options?.telemetrySegment ?? 'editor',
module: 'embed block',
control: 'confirm embed link',
other: status,
result: status,
});
}