sort username in account list

This commit is contained in:
creeper123123321 2021-02-26 11:54:55 -03:00 committed by GitHub
parent 104e36d36c
commit a61bf718ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,8 +218,8 @@ function addMcAccountToList(id, name, msUser = null) {
}
function refreshAccountList() {
accounts.innerHTML = "";
getMcAccounts().filter(isMojang).forEach(it => addMcAccountToList(it.id, it.name));
(myMSALObj.getAllAccounts() || []).forEach(msAccount => {
getMcAccounts().filter(isMojang).sort((a, b) => a.name.localeCompare(b.name)).forEach(it => addMcAccountToList(it.id, it.name));
(myMSALObj.getAllAccounts() || []).sort((a, b) => a.username.localeCompare(b.username)).forEach(msAccount => {
let mcAcc = findAccountByMs(msAccount.username) || {id: "MHF_Question", name: "..."};
addMcAccountToList(mcAcc.id, mcAcc.name, msAccount.username);
});