Hide custom emoji in reaction picker when BE does not advertise pleroma_custom_emoji_reactions

このコミットが含まれているのは:
Alexander Tumin 2023-03-02 11:13:05 +03:00
コミット 832019b2c2
5個のファイルの変更13行の追加2行の削除

ファイルの表示

@ -253,6 +253,7 @@ const getNodeInfo = async ({ store }) => {
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') }) store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') }) store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') })
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') }) store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
store.dispatch('setInstanceOption', { name: 'pleromaCustomEmojiReactionsAvailable', value: features.includes('pleroma_custom_emoji_reactions') })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') }) store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') })

ファイルの表示

@ -98,6 +98,11 @@ const EmojiPicker = {
required: false, required: false,
type: Boolean, type: Boolean,
default: false default: false
},
hideCustomEmoji: {
required: false,
type: Boolean,
default: false
} }
}, },
data () { data () {
@ -280,6 +285,9 @@ const EmojiPicker = {
return 0 return 0
}, },
allCustomGroups () { allCustomGroups () {
if (this.hideCustomEmoji) {
return {}
}
const emojis = this.$store.getters.groupedCustomEmojis const emojis = this.$store.getters.groupedCustomEmojis
if (emojis.unpacked) { if (emojis.unpacked) {
emojis.unpacked.text = this.$t('emoji.unpacked') emojis.unpacked.text = this.$t('emoji.unpacked')

ファイルの表示

@ -45,8 +45,8 @@ const ReactButton = {
} }
}, },
computed: { computed: {
mergedConfig () { hideCustomEmoji () {
return this.$store.getters.mergedConfig return !this.$store.state.instance.pleromaChatMessagesAvailable
} }
} }
} }

ファイルの表示

@ -3,6 +3,7 @@
<EmojiPicker <EmojiPicker
ref="picker" ref="picker"
:enable-sticker-picker="enableStickerPicker" :enable-sticker-picker="enableStickerPicker"
:hide-custom-emoji="hideCustomEmoji"
class="emoji-picker-panel" class="emoji-picker-panel"
@emoji="addReaction" @emoji="addReaction"
@show="onShow" @show="onShow"

ファイルの表示

@ -123,6 +123,7 @@ const defaultState = {
// Feature-set, apparently, not everything here is reported... // Feature-set, apparently, not everything here is reported...
shoutAvailable: false, shoutAvailable: false,
pleromaChatMessagesAvailable: false, pleromaChatMessagesAvailable: false,
pleromaCustomEmojiReactionsAvailable: false,
gopherAvailable: false, gopherAvailable: false,
mediaProxyAvailable: false, mediaProxyAvailable: false,
suggestionsEnabled: false, suggestionsEnabled: false,