From 8e8428b6678c94279bf044096d1418a559248252 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 May 2019 18:01:06 +0900 Subject: [PATCH] Fix bug --- .../app/common/views/components/url-preview.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index 6e0d73eef..9c61e4605 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -9,7 +9,7 @@
- +
@@ -61,7 +61,13 @@ export default Vue.extend({ }, data() { + const isSelf = this.url.startsWith(local); + const hasRoute = + this.url.substr(local.length).startsWith('/@') || + this.url.substr(local.length).startsWith('/notes/') || + this.url.substr(local.length).startsWith('/pages/'); return { + local, fetching: true, title: null, description: null, @@ -75,9 +81,10 @@ export default Vue.extend({ }, tweetUrl: null, playerEnabled: false, - local, - self: this.url.startsWith(local), - attr: this.url.startsWith(local) ? 'to' : 'href' + self: isSelf, + hasRoute: hasRoute, + attr: hasRoute ? 'to' : 'href', + target: hasRoute ? null : '_blank' }; },