mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
Remove session if it is being replaced (#212504)
A bug that has probably existed for quite a while... if we are replacing a session, we should say the old session is removed.
This commit is contained in:
parent
bbc0159f43
commit
9d4274e559
|
@ -306,14 +306,15 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
|||
this.afterSessionLoad(session);
|
||||
|
||||
const sessionIndex = sessions.findIndex(s => s.id === session.id || arrayEquals([...s.scopes].sort(), sortedScopes));
|
||||
const removed = new Array<vscode.AuthenticationSession>();
|
||||
if (sessionIndex > -1) {
|
||||
sessions.splice(sessionIndex, 1, session);
|
||||
removed.push(...sessions.splice(sessionIndex, 1, session));
|
||||
} else {
|
||||
sessions.push(session);
|
||||
}
|
||||
await this.storeSessions(sessions);
|
||||
|
||||
this._sessionChangeEmitter.fire({ added: [session], removed: [], changed: [] });
|
||||
this._sessionChangeEmitter.fire({ added: [session], removed, changed: [] });
|
||||
|
||||
this._logger.info('Login success!');
|
||||
|
||||
|
|
Loading…
Reference in a new issue