Skip to content

Commit 8f28c19

Browse files
committed
Checks for actual subscription changes in home
1 parent a788f5b commit 8f28c19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/webviews/home/homeWebview.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
141141
private readonly _disposable: Disposable;
142142
private _discovering: Promise<number | undefined> | undefined;
143143
private _etag?: number;
144+
private _etagSubscription?: number;
144145
private _pendingFocusAccount = false;
145146

146147
constructor(
@@ -632,6 +633,8 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
632633
}
633634

634635
private async onSubscriptionChanged(e: SubscriptionChangeEvent) {
636+
if (e.etag === this._etagSubscription) return;
637+
635638
await this.notifyDidChangeSubscription(e.current);
636639

637640
if (isSubscriptionStatePaidOrTrial(e.current.state) !== isSubscriptionStatePaidOrTrial(e.previous.state)) {
@@ -1021,6 +1024,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
10211024

10221025
private async getSubscriptionState(subscription?: Subscription) {
10231026
subscription = await this.getSubscription(subscription);
1027+
this._etagSubscription = this.container.subscription.etag;
10241028

10251029
let avatar;
10261030
if (subscription.account?.email) {

0 commit comments

Comments
 (0)