From daa6e21d754f5913edb30191c2f26526e537322c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 4 Feb 2021 17:07:55 +0100 Subject: [PATCH] put preferred clients first --- src/open/ClientListViewModel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/open/ClientListViewModel.js b/src/open/ClientListViewModel.js index df0c166..626d720 100644 --- a/src/open/ClientListViewModel.js +++ b/src/open/ClientListViewModel.js @@ -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(); }