From 8fb016a4f35c636d78d7050c30164d4b61087d98 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 2 Dec 2020 09:42:58 +0100 Subject: [PATCH] show homepage button if no other actions available --- src/client/ClientViewModel.js | 9 +++++++++ src/client/clients/Element.js | 3 +++ src/client/clients/Weechat.js | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/client/ClientViewModel.js b/src/client/ClientViewModel.js index 66f6d96..f41f526 100644 --- a/src/client/ClientViewModel.js +++ b/src/client/ClientViewModel.js @@ -62,6 +62,15 @@ export class ClientViewModel extends ViewModel { activated: () => this.preferences.setClient(client.id, webPlatform), }); } + if (actions.length === 0) { + actions.push({ + label: `Visit app homepage`, + url: client.homepage, + primary: true, + kind: "homepage", + activated: () => {}, + }); + } return actions; } diff --git a/src/client/clients/Element.js b/src/client/clients/Element.js index 152ee23..c0adb7d 100644 --- a/src/client/clients/Element.js +++ b/src/client/clients/Element.js @@ -34,6 +34,9 @@ export class Element { get description() { return 'Fully-featured Matrix client, used by millions.'; } + get homepage() { return "https://element.io"; } + get author() { return "https://element.io"; } + getMaturity(platform) { return Maturity.Stable; } getDeepLink(platform, link) { diff --git a/src/client/clients/Weechat.js b/src/client/clients/Weechat.js index 8894e97..301ebe1 100644 --- a/src/client/clients/Weechat.js +++ b/src/client/clients/Weechat.js @@ -23,6 +23,8 @@ export class Weechat { /* should only contain alphanumerical and -_, no dots (needs to be usable as css class) */ get id() { return "weechat"; } getName(platform) { return "Weechat"; } + get author() { return "Poljar"; } + get homepage() { return "https://github.com/poljar/weechat-matrix"; } get platforms() { return [Platform.Windows, Platform.macOS, Platform.Linux]; } get description() { return 'Command-line Matrix interface using Weechat'; } getMaturity(platform) { return Maturity.Beta; } @@ -36,7 +38,5 @@ export class Weechat { } } - getInstallLinks(platform) { - return [new WebsiteLink("https://github.com/poljar/weechat-matrix")]; - } + getInstallLinks(platform) {} } \ No newline at end of file