From 0494c770a1904bcb2abd82dce0e8163d33a34632 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 12 Mar 2019 12:59:26 +0900 Subject: [PATCH] Better share template --- src/client/app/desktop/views/pages/share.vue | 5 +++-- src/client/app/mobile/views/pages/share.vue | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client/app/desktop/views/pages/share.vue b/src/client/app/desktop/views/pages/share.vue index d20e6e864..bed9ae395 100644 --- a/src/client/app/desktop/views/pages/share.vue +++ b/src/client/app/desktop/views/pages/share.vue @@ -28,9 +28,10 @@ export default Vue.extend({ computed: { template(): string { let t = ''; - if (this.title) t += `【${title}】\n`; + if (this.title && this.url) t += `【[${title}](${url})】\n`; + if (this.title && !this.url) t += `【${title}】\n`; if (this.text) t += `${text}\n`; - if (this.url) t += `${url}`; + if (!this.title && this.url) t += `${url}`; return t.trim(); } }, diff --git a/src/client/app/mobile/views/pages/share.vue b/src/client/app/mobile/views/pages/share.vue index dbafc9e7b..e238d325d 100644 --- a/src/client/app/mobile/views/pages/share.vue +++ b/src/client/app/mobile/views/pages/share.vue @@ -28,9 +28,10 @@ export default Vue.extend({ computed: { template(): string { let t = ''; - if (this.title) t += `【${title}】\n`; + if (this.title && this.url) t += `【[${title}](${url})】\n`; + if (this.title && !this.url) t += `【${title}】\n`; if (this.text) t += `${text}\n`; - if (this.url) t += `${url}`; + if (!this.title && this.url) t += `${url}`; return t.trim(); } },