fix: ssr for emojis

This commit is contained in:
Anthony Fu 2022-12-27 21:56:43 +01:00
parent 2f8e47c947
commit c38b8c13ca

View file

@ -76,9 +76,11 @@ export async function setupI18n() {
}
export async function setupEmojis() {
const promise = import('@emoji-mart/data').then(r => r.default)
const { init } = await import('emoji-mart')
init({
data: () => promise,
})
if (process.client) {
const promise = import('@emoji-mart/data').then(r => r.default)
const { init } = await import('emoji-mart')
init({
data: () => promise,
})
}
}