feat: support custom emojis from other servers
This commit is contained in:
parent
f3a0a5af3f
commit
6d66bbbc5d
10 changed files with 40 additions and 16 deletions
|
@ -1,3 +1,4 @@
|
|||
import { emojisArrayToObject } from './utils'
|
||||
import type { ServerInfo } from '~/types'
|
||||
|
||||
const ServerInfoTTL = 60 * 60 * 1000 * 12 // 12 hour
|
||||
|
@ -19,7 +20,7 @@ async function _fetchServerInfo(server: string) {
|
|||
Object.assign(serverInfos.value[server], r)
|
||||
}),
|
||||
masto.customEmojis.fetchAll().then((r) => {
|
||||
serverInfos.value[server].customEmojis = Object.fromEntries(r.map(i => [i.shortcode, i]))
|
||||
serverInfos.value[server].customEmojis = emojisArrayToObject(r)
|
||||
}),
|
||||
])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue