Skip to content

Commit 0e5a5fb

Browse files
author
Rachel Macfarlane
committed
Set active account to undefined when sync disabled
1 parent 2a1f167 commit 0e5a5fb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/workbench/contrib/userDataSync/browser/userDataSyncAuthentication.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ export class UserDataSyncAuthentication extends Disposable implements IUserDataS
9797
}
9898

9999
async initializeActiveAccount(): Promise<void> {
100-
if (!this.userDataSyncEnablementService.isEnabled()) {
101-
return;
102-
}
103-
104100
const sessions = await this.authenticationService.getSessions(this._authenticationProviderId);
105101
// Auth provider has not yet been registered
106102
if (!sessions) {
107103
return;
108104
}
109105

106+
if (!this.userDataSyncEnablementService.isEnabled()) {
107+
this.setActiveAccount(undefined);
108+
}
109+
110110
if (sessions.length === 0) {
111111
await this.setActiveAccount(undefined);
112112
return;

0 commit comments

Comments
 (0)