Sort by game name

This commit is contained in:
Braedon Gough
2021-01-23 15:24:50 +01:00
parent f34200776c
commit 8ad36f299f
@@ -134,8 +134,13 @@ export class PackagesComponent implements OnInit {
}; };
}) })
.sort((a, b) => { .sort((a, b) => {
let textA = (a.name || a.packageName).toUpperCase(); const getGameName = (packageName: string) => {
let textB = (b.name || b.packageName).toUpperCase(); const split = packageName.split('.');
return split[split.length - 1];
};
let textA = (a.name || getGameName(a.packageName)).toUpperCase();
let textB = (b.name || getGameName(b.packageName)).toUpperCase();
return textA < textB ? -1 : textA > textB ? 1 : 0; return textA < textB ? -1 : textA > textB ? 1 : 0;
}); });
this.myApps.forEach(p => { this.myApps.forEach(p => {