Skip to content

Commit 5c98922

Browse files
authored
Avoid use of native private variables (microsoft#186756)
1 parent c778cc6 commit 5c98922

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
/* eslint-disable local/code-no-native-private */
7-
86
import { Disposable } from 'vs/base/common/lifecycle';
97
import { localize } from 'vs/nls';
108
import { Action2, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
@@ -40,7 +38,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
4038
private serverConfiguration = this.productService['editSessions.store'];
4139
private machineClient: IUserDataSyncMachinesService | undefined;
4240

43-
#authenticationInfo: { sessionId: string; token: string; providerId: string } | undefined;
41+
private authenticationInfo: { sessionId: string; token: string; providerId: string } | undefined;
4442
private static CACHED_SESSION_STORAGE_KEY = 'editSessionAccountPreference';
4543

4644
private initialized = false;
@@ -227,13 +225,13 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
227225
}
228226

229227
// If we already have an existing auth session in memory, use that
230-
if (this.#authenticationInfo !== undefined) {
228+
if (this.authenticationInfo !== undefined) {
231229
return true;
232230
}
233231

234232
const authenticationSession = await this.getAuthenticationSession(silent);
235233
if (authenticationSession !== undefined) {
236-
this.#authenticationInfo = authenticationSession;
234+
this.authenticationInfo = authenticationSession;
237235
this.storeClient.setAuthToken(authenticationSession.token, authenticationSession.providerId);
238236
}
239237

@@ -436,25 +434,25 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
436434
&& e.scope === StorageScope.APPLICATION
437435
) {
438436
const newSessionId = this.existingSessionId;
439-
const previousSessionId = this.#authenticationInfo?.sessionId;
437+
const previousSessionId = this.authenticationInfo?.sessionId;
440438

441439
if (previousSessionId !== newSessionId) {
442440
this.logService.trace(`Resetting authentication state because authentication session ID preference changed from ${previousSessionId} to ${newSessionId}.`);
443-
this.#authenticationInfo = undefined;
441+
this.authenticationInfo = undefined;
444442
this.initialized = false;
445443
}
446444
}
447445
}
448446

449447
private clearAuthenticationPreference(): void {
450-
this.#authenticationInfo = undefined;
448+
this.authenticationInfo = undefined;
451449
this.initialized = false;
452450
this.existingSessionId = undefined;
453451
this.signedInContext.set(false);
454452
}
455453

456454
private onDidChangeSessions(e: AuthenticationSessionsChangeEvent): void {
457-
if (this.#authenticationInfo?.sessionId && e.removed.find(session => session.id === this.#authenticationInfo?.sessionId)) {
455+
if (this.authenticationInfo?.sessionId && e.removed.find(session => session.id === this.authenticationInfo?.sessionId)) {
458456
this.clearAuthenticationPreference();
459457
}
460458
}

0 commit comments

Comments
 (0)