Skip to content
Snippets Groups Projects

feat: show all accounts in VS Code accounts view

Merged Tomas Vik requested to merge tv/2025-02/use-authentication-api into main
All threads resolved!
1 file
+ 3
4
Compare changes
  • Side-by-side
  • Inline
import vscode from 'vscode';
import { differenceBy } from 'lodash';
import { accountService, AccountService } from '../account_service';
import { Account } from '../../../common/platform/gitlab_account';
@@ -13,10 +14,8 @@ const convertAccountToSession = (account: Account): vscode.AuthenticationSession
});
const makeDiff = (prev: Account[], next: Account[]) => {
const prevIds = prev.map(a => a.id);
const nextIds = next.map(a => a.id);
const added = next.filter(a => !prevIds.includes(a.id)).map(convertAccountToSession);
const removed = prev.filter(a => !nextIds.includes(a.id)).map(convertAccountToSession);
const added = differenceBy(next, prev, a => a.id).map(convertAccountToSession);
const removed = differenceBy(prev, next, a => a.id).map(convertAccountToSession);
return { added, removed, changed: undefined };
};
Loading