From 835eaf312127ffdf91940a47358af95f153ece39 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 19 Feb 2022 00:20:49 -0500 Subject: [PATCH] Fixes sign out issues not causing proper updates --- src/premium/subscription/subscriptionService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/premium/subscription/subscriptionService.ts b/src/premium/subscription/subscriptionService.ts index 728bf34..cce30a5 100644 --- a/src/premium/subscription/subscriptionService.ts +++ b/src/premium/subscription/subscriptionService.ts @@ -84,7 +84,7 @@ export class SubscriptionService implements Disposable { private onAuthenticationChanged(e: AuthenticationSessionsChangeEvent): void { if (e.provider.id !== SubscriptionService.authenticationProviderId) return; - void this.ensureSession(false); + void this.ensureSession(false, true); } @memoize() @@ -473,13 +473,13 @@ export class SubscriptionService implements Disposable { @gate() @debug() - private async ensureSession(createIfNeeded: boolean): Promise { + private async ensureSession(createIfNeeded: boolean, force?: boolean): Promise { if (this._sessionPromise != null && this._session === undefined) { this._session = await this._sessionPromise; this._sessionPromise = undefined; } - if (this._session != null) return this._session; + if (!force && this._session != null) return this._session; if (this._session === null && !createIfNeeded) return undefined; if (createIfNeeded) {