From 614388e663ec93b1e4de6b7df96bdfb8d7e1ee4b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 7 Dec 2020 14:06:16 +0100 Subject: [PATCH] don't differentiate name between platforms --- src/open/ClientViewModel.js | 11 ++++------- src/open/clients/Element.js | 10 +--------- src/open/clients/Fractal.js | 2 +- src/open/clients/Nheko.js | 2 +- src/open/clients/Weechat.js | 2 +- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/open/ClientViewModel.js b/src/open/ClientViewModel.js index d8c58d5..7c26324 100644 --- a/src/open/ClientViewModel.js +++ b/src/open/ClientViewModel.js @@ -66,7 +66,7 @@ export class ClientViewModel extends ViewModel { const webDeepLink = client.getDeepLink(webPlatform, link); if (webDeepLink) { actions.push({ - label: `Or open in ${client.getName(webPlatform)}`, + label: `Or open in web app`, url: webDeepLink, kind: "open-in-web", activated: () => this.preferences.setClient(client.id, webPlatform), @@ -98,7 +98,7 @@ export class ClientViewModel extends ViewModel { } get name() { - return this._client.getName(this._platform); + return this._client.name; } get iconUrl() { @@ -144,11 +144,8 @@ export class ClientViewModel extends ViewModel { } get deepLink() { - return this._client.getDeepLink(this._platform, this._link); - } - - get _platform() { - return this.showBack ? this._proposedPlatform : this._nativePlatform; + const platform = this.showBack ? this._proposedPlatform : this._nativePlatform; + return this._client.getDeepLink(platform, this._link); } deepLinkActivated() { diff --git a/src/open/clients/Element.js b/src/open/clients/Element.js index a467668..e793b4d 100644 --- a/src/open/clients/Element.js +++ b/src/open/clients/Element.js @@ -37,6 +37,7 @@ export class Element { get appleAssociatedAppId() { return "7J4U792NQT.im.vector.app"; } + get name() {return "Element"; } get description() { return 'Fully-featured Matrix client, used by millions.'; } get homepage() { return ; } // prevents a visit app homepage button from appearing @@ -71,15 +72,6 @@ export class Element { getLinkInstructions(platform, link) {} getCopyString(platform, link) {} - - getName(platform) { - if (platform === Platform.DesktopWeb || platform === Platform.MobileWeb) { - return "Element Web"; - } else { - return "Element"; - } - } - getInstallLinks(platform) { switch (platform) { case Platform.iOS: return [new AppleStoreLink('vector', 'id1083446067')]; diff --git a/src/open/clients/Fractal.js b/src/open/clients/Fractal.js index be51744..47310af 100644 --- a/src/open/clients/Fractal.js +++ b/src/open/clients/Fractal.js @@ -21,7 +21,7 @@ import {Maturity, Platform, LinkKind, FlathubLink} from "../types.js"; */ export class Fractal { get id() { return "fractal"; } - getName(platform) { return "Fractal"; } + get name() { return "Fractal"; } get icon() { return "images/client-icons/fractal.png"; } get author() { return "Daniel Garcia Moreno"; } get homepage() { return "https://gitlab.gnome.org/GNOME/fractal"; } diff --git a/src/open/clients/Nheko.js b/src/open/clients/Nheko.js index 064f6bd..2f860ee 100644 --- a/src/open/clients/Nheko.js +++ b/src/open/clients/Nheko.js @@ -21,7 +21,7 @@ import {Maturity, Platform, LinkKind, FlathubLink} from "../types.js"; */ export class Nheko { get id() { return "nheko"; } - getName(platform) { return "Nheko"; } + get name() { return "Nheko"; } get icon() { return "images/client-icons/nheko.svg"; } get author() { return "mujx, red_sky, deepbluev7, Konstantinos Sideris"; } get homepage() { return "https://github.com/Nheko-Reborn/nheko"; } diff --git a/src/open/clients/Weechat.js b/src/open/clients/Weechat.js index 2a018b7..9d37efc 100644 --- a/src/open/clients/Weechat.js +++ b/src/open/clients/Weechat.js @@ -21,7 +21,7 @@ import {Maturity, Platform, LinkKind, WebsiteLink} from "../types.js"; */ export class Weechat { get id() { return "weechat"; } - getName(platform) { return "Weechat"; } + get name() { return "Weechat"; } get icon() { return "images/client-icons/weechat.svg"; } get author() { return "Poljar"; } get homepage() { return "https://github.com/poljar/weechat-matrix"; }