forked from AkkomaGang/akkoma-fe
support new custom emoji format
This commit is contained in:
parent
d7cf841dfe
commit
a25aabfa10
1 changed files with 3 additions and 2 deletions
|
@ -171,9 +171,10 @@ const getCustomEmoji = async ({ store }) => {
|
||||||
try {
|
try {
|
||||||
const res = await window.fetch('/api/pleroma/emoji.json')
|
const res = await window.fetch('/api/pleroma/emoji.json')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const values = await res.json()
|
const result = await res.json()
|
||||||
|
const values = Array.isArray(result) ? Object.assign({}, ...result) : result
|
||||||
const emoji = Object.keys(values).map((key) => {
|
const emoji = Object.keys(values).map((key) => {
|
||||||
return { shortcode: key, image_url: values[key] }
|
return { shortcode: key, image_url: values[key].image_url || values[key] }
|
||||||
})
|
})
|
||||||
store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji })
|
store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji })
|
||||||
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true })
|
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true })
|
||||||
|
|
Loading…
Reference in a new issue