forked from AkkomaGang/akkoma-fe
Merge branch 'fix-emoji-picker' into 'develop'
support new custom emoji format Closes #484 See merge request pleroma/pleroma-fe!746
This commit is contained in:
commit
25601c6873
1 changed files with 3 additions and 2 deletions
|
@ -171,9 +171,10 @@ const getCustomEmoji = async ({ store }) => {
|
|||
try {
|
||||
const res = await window.fetch('/api/pleroma/emoji.json')
|
||||
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) => {
|
||||
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: 'pleromaBackend', value: true })
|
||||
|
|
Loading…
Reference in a new issue