Make onDidChangeSessions event for auth providers fire complete session

This commit is contained in:
Rachel Macfarlane
2021-02-11 09:43:12 -08:00
parent 42edcdb41b
commit 9118a3461c
9 changed files with 77 additions and 50 deletions

View File

@@ -122,10 +122,9 @@ export class MainThreadAuthenticationProvider extends Disposable {
async updateSessionItems(event: modes.AuthenticationSessionsChangeEvent): Promise<void> {
const { added, removed } = event;
const session = await this._proxy.$getSessions(this.id);
const addedSessions = session.filter(session => added.some(id => id === session.id));
removed.forEach(sessionId => {
removed.forEach(session => {
const sessionId = session.id;
const accountName = this._sessions.get(sessionId);
if (accountName) {
this._sessions.delete(sessionId);
@@ -139,7 +138,7 @@ export class MainThreadAuthenticationProvider extends Disposable {
}
});
addedSessions.forEach(session => this.registerSession(session));
added.forEach(session => this.registerSession(session));
}
login(scopes: string[]): Promise<modes.AuthenticationSession> {