From 411f038f34ad0283c5c24285a06701276aa4f6b9 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 5 Jul 2019 17:58:54 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0?= =?UTF-8?q?=E7=B5=B5=E6=96=87=E5=AD=97=E3=83=AA=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=8C=E3=81=9F=E3=81=BE=E3=81=AB=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=86=20(#5105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/components/emoji.vue | 16 +++++++++++++++- .../common/views/components/reaction-icon.vue | 7 ++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/emoji.vue b/src/client/app/common/views/components/emoji.vue index 0cc78a337..20c1ea1a8 100644 --- a/src/client/app/common/views/components/emoji.vue +++ b/src/client/app/common/views/components/emoji.vue @@ -55,6 +55,20 @@ export default Vue.extend({ } }, + watch: { + customEmojis() { + if (this.name) { + const customEmoji = this.customEmojis.find(x => x.name == this.name); + if (customEmoji) { + this.customEmoji = customEmoji; + this.url = this.$store.state.device.disableShowingAnimatedImages + ? getStaticImageUrl(customEmoji.url) + : customEmoji.url; + } + } + }, + }, + created() { if (this.name) { const customEmoji = this.customEmojis.find(x => x.name == this.name); @@ -80,7 +94,7 @@ export default Vue.extend({ this.url = `${twemojiBase}/2/svg/${codes.join('-')}.svg`; } - } + }, }); diff --git a/src/client/app/common/views/components/reaction-icon.vue b/src/client/app/common/views/components/reaction-icon.vue index 022d57dc4..afe51d783 100644 --- a/src/client/app/common/views/components/reaction-icon.vue +++ b/src/client/app/common/views/components/reaction-icon.vue @@ -15,9 +15,14 @@ export default Vue.extend({ }, data() { return { - customEmojis: (this.$root.getMetaSync() || { emojis: [] }).emojis || [] + customEmojis: [] }; }, + created() { + this.$root.getMeta().then(meta => { + if (meta && meta.emojis) this.customEmojis = meta.emojis; + }); + }, computed: { str(): any { switch (this.reaction) {