diff --git a/src/client/ClientView.js b/src/client/ClientView.js index 98b309c..143365f 100644 --- a/src/client/ClientView.js +++ b/src/client/ClientView.js @@ -95,6 +95,14 @@ class InstallClientView extends TemplateView { })); children.push(actions); + if (vm.showDeepLinkInInstall) { + const deepLink = t.a({ + rel: "noopener noreferrer", + href: vm.deepLink, + }, "open it here"); + children.push(t.p([`If you already have ${vm.name} installed, you can `, deepLink, "."])) + } + return t.div({className: "InstallClientView"}, children); } } \ No newline at end of file diff --git a/src/client/ClientViewModel.js b/src/client/ClientViewModel.js index f41f526..e202b25 100644 --- a/src/client/ClientViewModel.js +++ b/src/client/ClientViewModel.js @@ -37,7 +37,8 @@ export class ClientViewModel extends ViewModel { this.actions = this._createActions(client, link, nativePlatform, webPlatform); this.name = this._client.getName(this._proposedPlatform); this.deepLink = this._client.getDeepLink(this._proposedPlatform, this._link); - this._showOpen = this.deepLink && nativePlatform && !client.canInterceptMatrixToLinks(nativePlatform); + this._clientCanIntercept = !!(nativePlatform && client.canInterceptMatrixToLinks(nativePlatform)); + this._showOpen = this.deepLink && !this._clientCanIntercept; } _createActions(client, link, nativePlatform, webPlatform) { @@ -94,6 +95,10 @@ export class ClientViewModel extends ViewModel { return this._client.getLinkInstructions(this._proposedPlatform, this._link); } + get showDeepLinkInInstall() { + return this._clientCanIntercept && this.deepLink; + } + get availableOnPlatformNames() { const platforms = this._client.platforms; const textPlatforms = [];