Fix: カスタム絵文字リアクションがたまに文字になってしまう (#5105)

This commit is contained in:
MeiMei 2019-07-05 17:58:54 +09:00 committed by syuilo
parent ab79ca0794
commit bc0e3aa4d3
2 changed files with 21 additions and 2 deletions

View file

@ -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() { created() {
if (this.name) { if (this.name) {
const customEmoji = this.customEmojis.find(x => x.name == 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`; this.url = `${twemojiBase}/2/svg/${codes.join('-')}.svg`;
} }
} },
}); });
</script> </script>

View file

@ -15,9 +15,14 @@ export default Vue.extend({
}, },
data() { data() {
return { return {
customEmojis: (this.$root.getMetaSync() || { emojis: [] }).emojis || [] customEmojis: []
}; };
}, },
created() {
this.$root.getMeta().then(meta => {
if (meta && meta.emojis) this.customEmojis = meta.emojis;
});
},
computed: { computed: {
str(): any { str(): any {
switch (this.reaction) { switch (this.reaction) {