From 8cd70a7225355e5af6f0eaa1aa1c1833dfb23702 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Feb 2020 23:17:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=AA=E3=82=93=E3=81=8B=E3=82=82=E3=81=86?= =?UTF-8?q?=E3=82=81=E3=81=A3=E3=81=A1=E3=82=83=E5=A4=89=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #5846 --- locales/ja-JP.yml | 1 + src/client/components/autocomplete.vue | 2 +- src/client/components/emoji-picker.vue | 2 +- src/client/components/emoji.vue | 43 ++++---- src/client/components/mfm.ts | 3 +- src/client/components/post-form.vue | 8 +- src/client/components/reaction-icon.vue | 12 +-- src/client/components/signin.vue | 11 ++- src/client/components/signup.vue | 11 +-- src/client/init.ts | 2 - src/client/mios.ts | 61 +----------- src/client/pages/about.vue | 11 ++- src/client/pages/explore.vue | 7 +- src/client/pages/index.home.vue | 9 -- src/client/pages/index.welcome.entrance.vue | 27 ++---- src/client/pages/index.welcome.vue | 11 +-- .../pages/instance/federation.instance.vue | 34 +++---- src/client/pages/instance/index.vue | 97 ++++++++++--------- src/client/pages/settings/integration.vue | 14 +-- src/client/store.ts | 28 +++++- 20 files changed, 173 insertions(+), 221 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 258b82dea..c68f9408a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -376,6 +376,7 @@ next: "次" retype: "再入力" noteOf: "{user}のノート" inviteToGroup: "グループに招待" +maxNoteTextLength: "ノートの文字数制限" _tutorial: title: "Misskeyの使い方" diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue index 2ab837a2c..f17351a6f 100644 --- a/src/client/components/autocomplete.vue +++ b/src/client/components/autocomplete.vue @@ -143,7 +143,7 @@ export default Vue.extend({ this.setPosition(); //#region Construct Emoji DB - const customEmojis = (this.$root.getMetaSync() || { emojis: [] }).emojis || []; + const customEmojis = this.$store.state.instance.meta.emojis; const emojiDefinitions: EmojiDef[] = []; for (const x of customEmojis) { diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index 61d641a02..a647b0ea0 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -140,7 +140,7 @@ export default Vue.extend({ }, created() { - let local = (this.$root.getMetaSync() || { emojis: [] }).emojis || []; + let local = this.$store.state.instance.meta.emojis; local = groupByX(local, (x: any) => x.category || ''); this.customEmojis = local; }, diff --git a/src/client/components/emoji.vue b/src/client/components/emoji.vue index 2e8bddb80..7784a1bf1 100644 --- a/src/client/components/emoji.vue +++ b/src/client/components/emoji.vue @@ -55,38 +55,35 @@ export default Vue.extend({ useOsDefaultEmojis(): boolean { return this.$store.state.device.useOsDefaultEmojis && !this.isReaction; + }, + + ce() { + let ce = []; + if (this.customEmojis) ce = ce.concat(this.customEmojis); + if (this.$store.state.instance.meta && this.$store.state.instance.meta.emojis) ce = ce.concat(this.$store.state.instance.meta.emojis); + return ce; } }, 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; + ce: { + handler() { + if (this.name) { + const customEmoji = this.ce.find(x => x.name == this.name); + if (customEmoji) { + this.customEmoji = customEmoji; + this.url = this.$store.state.device.disableShowingAnimatedImages + ? getStaticImageUrl(customEmoji.url) + : customEmoji.url; + } } - } + }, + immediate: true }, }, created() { - 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; - } else { - //const emoji = lib[this.name]; - //if (emoji) { - // this.char = emoji.char; - //} - } - } else { + if (!this.name) { this.char = this.emoji; } diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts index 719e9fe94..275167836 100644 --- a/src/client/components/mfm.ts +++ b/src/client/components/mfm.ts @@ -234,7 +234,6 @@ export default Vue.component('misskey-flavored-markdown', { } case 'emoji': { - const customEmojis = (this.$root.getMetaSync() || { emojis: [] }).emojis || []; return [createElement('mk-emoji', { key: Math.random(), attrs: { @@ -242,7 +241,7 @@ export default Vue.component('misskey-flavored-markdown', { name: token.node.props.name }, props: { - customEmojis: this.customEmojis || customEmojis, + customEmojis: this.customEmojis, normal: this.plain } })]; diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index 6716fa1b7..6645c4f1f 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -8,7 +8,7 @@
- {{ 500 - trimmedLength(text) }} + {{ max - trimmedLength(text) }}