aboutsummaryrefslogtreecommitdiff
path: root/src/boot/after_store.js
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-09-26 21:14:31 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-09-26 21:14:31 +0300
commit19cb98b85fc071dccd88bcdddff75d99cd4d944d (patch)
treea99d9ed2ab174eea4533146b8f97c6bde9170eae /src/boot/after_store.js
parentc02433b7e69d4e19be50cb513327a8985f262998 (diff)
parent501208d350a9bd0fbcafb13d70a2fa6182fb8cf3 (diff)
Merge branch 'develop' into feature/following_reblogs
Diffstat (limited to 'src/boot/after_store.js')
-rw-r--r--src/boot/after_store.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 5cb2acba..490ac4d0 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -184,7 +184,7 @@ const getStaticEmoji = async ({ store }) => {
imageUrl: false,
replacement: values[key]
}
- })
+ }).sort((a, b) => a.displayText - b.displayText)
store.dispatch('setInstanceOption', { name: 'emoji', value: emoji })
} else {
throw (res)
@@ -203,14 +203,16 @@ const getCustomEmoji = async ({ store }) => {
if (res.ok) {
const result = await res.json()
const values = Array.isArray(result) ? Object.assign({}, ...result) : result
- const emoji = Object.keys(values).map((key) => {
- const imageUrl = values[key].image_url
+ const emoji = Object.entries(values).map(([key, value]) => {
+ const imageUrl = value.image_url
return {
displayText: key,
- imageUrl: imageUrl ? store.state.instance.server + imageUrl : values[key],
+ imageUrl: imageUrl ? store.state.instance.server + imageUrl : value,
+ tags: imageUrl ? value.tags.sort((a, b) => a > b ? 1 : 0) : ['utf'],
replacement: `:${key}: `
}
- })
+ // Technically could use tags but those are kinda useless right now, should have been "pack" field, that would be more useful
+ }).sort((a, b) => a.displayText.toLowerCase() > b.displayText.toLowerCase() ? 1 : 0)
store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji })
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true })
} else {