put preferred clients first

This commit is contained in:
Bruno Windels 2021-02-04 17:07:55 +01:00
parent 8a23b9a49e
commit daa6e21d75

View File

@ -54,7 +54,7 @@ export class ClientListViewModel extends ViewModel {
}
_filterClients() {
this.clientList = this._clients.filter(client => {
const clientVMs = this._clients.filter(client => {
const platformMaturities = this.platforms.map(p => client.getMaturity(p));
const isStable = platformMaturities.includes(Maturity.Stable) || platformMaturities.includes(Maturity.Beta);
const isSupported = client.platforms.some(p => this.platforms.includes(p));
@ -70,6 +70,9 @@ export class ClientListViewModel extends ViewModel {
link: this._link,
pickClient: client => this._pickClient(client)
})));
const preferredClientVMs = clientVMs.filter(c => c.hasPreferredWebInstance);
const otherClientVMs = clientVMs.filter(c => !c.hasPreferredWebInstance);
this.clientList = preferredClientVMs.concat(otherClientVMs);
this.emitChange();
}