Fix: clicking on the import custom emojis button, without selected any file, was resulting in a state with all action button disabled.

This commit is contained in:
John Livingston 2024-06-20 14:39:15 +02:00
parent 4149207317
commit 1be95f01b1
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 10.1.2
* Fix: clicking on the import custom emojis button, without selected any file, was resulting in a state with all action button disabled.
## 10.1.1
* Fix #436: Saving emojis per batch, to avoid hitting max payload limit.

View File

@ -132,7 +132,6 @@ export class ChannelEmojisElement extends LivechatElement {
*/
public async importEmojis (ev: Event): Promise<void> {
ev.preventDefault()
this.actionDisabled = true
try {
// download a json file:
const file = await new Promise<File>((resolve, reject) => {
@ -153,6 +152,8 @@ export class ChannelEmojisElement extends LivechatElement {
input.remove()
})
this.actionDisabled = true
const content = await new Promise<string>((resolve, reject) => {
const fileReader = new FileReader()
fileReader.onerror = reject