From 8a3896eef5bc9c2a7f9244d4aa966304b46c0044 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 4 Feb 2021 17:11:10 +0100 Subject: [PATCH] fix clients that don't support deeplinking ...from showing a broken continue button --- src/open/ClientViewModel.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/open/ClientViewModel.js b/src/open/ClientViewModel.js index 4dfa469..a43fdad 100644 --- a/src/open/ClientViewModel.js +++ b/src/open/ClientViewModel.js @@ -62,20 +62,23 @@ export class ClientViewModel extends ViewModel { } } const actions = []; - actions.push({ - label: deepLinkLabel, - url: this._client.getDeepLink(this._proposedPlatform, this._link), - primary: true, - activated: () => { - this._pickClient(this._client); - this.preferences.setClient(this._client.id, this._proposedPlatform); - // only show install screen if we tried to open a native deeplink - if (this._showOpen && this._proposedPlatform === this._nativePlatform) { - this._showOpen = false; - this.emitChange(); - } - }, - }); + const proposedDeepLink = this._client.getDeepLink(this._proposedPlatform, this._link); + if (proposedDeepLink) { + actions.push({ + label: deepLinkLabel, + url: proposedDeepLink, + primary: true, + activated: () => { + this._pickClient(this._client); + this.preferences.setClient(this._client.id, this._proposedPlatform); + // only show install screen if we tried to open a native deeplink + if (this._showOpen && this._proposedPlatform === this._nativePlatform) { + this._showOpen = false; + this.emitChange(); + } + }, + }); + } // show only if there is a preferred instance, and if we don't already link to it in the first button if (hasPreferredWebInstance && this._webPlatform && this._proposedPlatform !== this._webPlatform) { actions.push({