upd: return empty list on empty custom emoji

This commit is contained in:
Mar0xy 2023-09-25 05:16:13 +02:00
parent 5aa2b197da
commit 62b2c31655
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828

View file

@ -2178,7 +2178,7 @@ export default class Misskey implements MegalodonInterface {
public async getInstanceCustomEmojis(): Promise<Response<Array<Entity.Emoji>>> {
return this.client
.get<{ emojis: Array<MisskeyAPI.Entity.Emoji> }>('/api/emojis')
.then(res => ({ ...res, data: res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) }))
.then(res => ({ ...res, data: res.data.emojis && res.data.emojis.length > 0 ? res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) : [] }))
}
// ======================================