show homepage button if no other actions available

This commit is contained in:
Bruno Windels 2020-12-02 09:42:58 +01:00
parent 9b7c3c2389
commit 8fb016a4f3
3 changed files with 15 additions and 3 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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) {}
}