浏览代码

updates SubscriptionService to only track changes

main
Keith Daulton 2 年前
父节点
当前提交
1bb02230d8
共有 1 个文件被更改,包括 4 次插入7 次删除
  1. +4
    -7
      src/plus/subscription/subscriptionService.ts

+ 4
- 7
src/plus/subscription/subscriptionService.ts 查看文件

@ -847,6 +847,9 @@ export class SubscriptionService implements Disposable {
// Check the previous and new subscriptions are exactly the same
const matches = previous != null && JSON.stringify(previous) === JSON.stringify(subscription);
// If the previous and new subscriptions are exactly the same, kick out
if (matches) return;
queueMicrotask(() => {
this.container.telemetry.setGlobalAttributes({
'account.id': subscription!.account?.id,
@ -889,15 +892,9 @@ export class SubscriptionService implements Disposable {
: {}),
};
this.container.telemetry.sendEvent(
previous == null || matches ? 'subscription' : 'subscription/changed',
data,
);
this.container.telemetry.sendEvent(previous == null ? 'subscription' : 'subscription/changed', data);
});
// If the previous and new subscriptions are exactly the same, kick out
if (matches) return;
void this.storeSubscription(subscription);
this._subscription = subscription;

正在加载...
取消
保存