feat: support custom emoji
This commit is contained in:
parent
193d1cf5c5
commit
cefecb16a0
6 changed files with 48 additions and 26 deletions
|
@ -1,3 +1,5 @@
|
|||
import type { Emoji } from 'masto'
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
content: {
|
||||
|
@ -6,6 +8,15 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
setup(props) {
|
||||
return () => contentToVNode(props.content)
|
||||
const emojis = shallowRef<Record<string, Emoji>>({})
|
||||
|
||||
onMounted(() => {
|
||||
const { server } = useAppCookies()
|
||||
const { serverInfos } = useClientState()
|
||||
if (server.value)
|
||||
emojis.value = serverInfos.value[server.value].customEmojis || {}
|
||||
})
|
||||
|
||||
return () => h('div', { class: 'rich-content' }, contentToVNode(props.content, undefined, emojis.value))
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue