From 163f405ae5afaaba4ffe6751f7ddc595de72099e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 5 Feb 2021 13:00:13 +0100 Subject: [PATCH] ensure the preferred platform is supported --- src/open/ClientViewModel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/open/ClientViewModel.js b/src/open/ClientViewModel.js index a43fdad..e1b3db5 100644 --- a/src/open/ClientViewModel.js +++ b/src/open/ClientViewModel.js @@ -42,7 +42,8 @@ export class ClientViewModel extends ViewModel { const matchingPlatforms = getMatchingPlatforms(this._client, this.platforms); this._webPlatform = matchingPlatforms.find(p => isWebPlatform(p)); this._nativePlatform = matchingPlatforms.find(p => !isWebPlatform(p)); - this._proposedPlatform = this.preferences.platform || this._nativePlatform || webPlatform; + const preferredPlatform = matchingPlatforms.find(p => p === this.preferences.platform); + this._proposedPlatform = preferredPlatform || this._nativePlatform || webPlatform; this.openActions = this._createOpenActions(); this.installActions = this._createInstallActions();