summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-05-27 18:01:06 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-05-27 18:01:06 +0900
commit8e8428b6678c94279bf044096d1418a559248252 (patch)
tree5d33a1a23a540212f2fc0708ddd9f6e41ecff956 /src/client
parentImprove job queue view (diff)
downloadmisskey-8e8428b6678c94279bf044096d1418a559248252.tar.gz
misskey-8e8428b6678c94279bf044096d1418a559248252.tar.bz2
misskey-8e8428b6678c94279bf044096d1418a559248252.zip
Fix bug
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/views/components/url-preview.vue15
1 files 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 6e0d73eef5..9c61e46059 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 @@
</blockquote>
</div>
<div v-else class="mk-url-preview">
- <component :is="self ? 'router-link' : 'a'" :class="{ mini: narrow, compact }" :[attr]="self ? url.substr(local.length) : url" rel="nofollow noopener" :target="self ? null : '_blank'" :title="url" v-if="!fetching">
+ <component :is="hasRoute ? 'router-link' : 'a'" :class="{ mini: narrow, compact }" :[attr]="hasRoute ? url.substr(local.length) : url" rel="nofollow noopener" :target="target" :title="url" v-if="!fetching">
<div class="thumbnail" v-if="thumbnail" :style="`background-image: url('${thumbnail}')`">
<button v-if="!playerEnabled && player.url" @click.prevent="playerEnabled = true" :title="$t('enable-player')"><fa :icon="['far', 'play-circle']"/></button>
</div>
@@ -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'
};
},