Custom emojis: import/export functions.

This commit is contained in:
John Livingston
2024-06-10 19:07:55 +02:00
parent c6513f922b
commit 6f56a026bb
5 changed files with 172 additions and 1 deletions

View File

@ -80,7 +80,6 @@ export class ImageFileInputElement extends LivechatElement {
try {
const base64 = await new Promise<string>((resolve, reject) => {
const fileReader = new FileReader()
fileReader.readAsDataURL(file)
fileReader.onload = () => {
if (fileReader.result === null) {
reject(new Error('Empty result'))
@ -93,6 +92,7 @@ export class ImageFileInputElement extends LivechatElement {
}
}
fileReader.onerror = reject
fileReader.readAsDataURL(file)
})
this.value = base64