summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/components/mention.vue12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/components/mention.vue b/src/client/components/mention.vue
index 0303e0e5b5..dd68aab146 100644
--- a/src/client/components/mention.vue
+++ b/src/client/components/mention.vue
@@ -18,6 +18,7 @@
import Vue from 'vue';
import { toUnicode } from 'punycode';
import { host as localHost } from '../config';
+import { wellKnownServices } from '../../well-known-services';
export default Vue.extend({
props: {
@@ -37,12 +38,11 @@ export default Vue.extend({
},
computed: {
url(): string {
- switch (this.host) {
- case 'twitter.com':
- case 'github.com':
- return `https://${this.host}/${this.username}`;
- default:
- return `/${this.canonical}`;
+ const wellKnown = wellKnownServices.find(x => x[0] === this.host);
+ if (wellKnown) {
+ return wellKnown[1](this.username);
+ } else {
+ return `/${this.canonical}`;
}
},
canonical(): string {