forked from mirrors/akkoma-fe
Accept full URLs for /api/v1/pleroma/emoji
The frontend assumes these URLs will be relative to the target instance, which may not be the case due to object storage and such configurations.
This commit is contained in:
parent
8da18fc209
commit
c147c2aeb3
1 changed files with 5 additions and 2 deletions
|
|
@ -182,10 +182,13 @@ const instance = {
|
|||
const result = await res.json()
|
||||
const values = Array.isArray(result) ? Object.assign({}, ...result) : result
|
||||
const emoji = Object.entries(values).map(([key, value]) => {
|
||||
const imageUrl = value.image_url
|
||||
let imageUrl = value.image_url
|
||||
if (typeof imageUrl == 'string' && imageUrl.startsWith('/'))
|
||||
imageUrl = state.server + imageUrl;
|
||||
|
||||
return {
|
||||
displayText: key,
|
||||
imageUrl: imageUrl ? state.server + imageUrl : value,
|
||||
imageUrl: imageUrl ? imageUrl : value,
|
||||
tags: imageUrl ? value.tags.sort((a, b) => a > b ? 1 : 0) : ['utf'],
|
||||
replacement: `:${key}: `
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue