More coherent use of await.

This commit is contained in:
Chloe Herd 2023-03-22 14:16:57 -04:00
parent 0b94d83129
commit 5b6433cb1c

View file

@ -145,17 +145,15 @@ export default {
this.isImageProcessing = true;
await this.imageQuestionSubmitHandler(file)
.then(async (response) => {
this.value = response;
try {
this.value = await this.imageQuestionSubmitHandler(file);
await this.$nextTick();
await this.$nextTick();
document.getElementById(this.inputId).dispatchEvent(new Event("change"));
})
.catch((error) => {
this.$emit("imageLookupError");
});
document.getElementById(this.inputId).dispatchEvent(new Event("change"));
} catch (error) {
this.$emit("imageLookupError");
}
this.isImageProcessing = false;
},