Await event emission

bc6c598796254f931968d75f42734678f3d3c58c

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Ignore whitespace
public/scripts/extensions/stable-diffusion/index.js+1 -1
@@ -2404,7 +2404,7 @@ async function generatePicture(initiator, args, trigger, message, callback) {
2404 const callbackOriginal = callback;2404 const callbackOriginal = callback;
2405 callback = async function (prompt, imagePath, generationType, _negativePromptPrefix, _initiator, prefixedPrompt) {2405 callback = async function (prompt, imagePath, generationType, _negativePromptPrefix, _initiator, prefixedPrompt) {
2406 const imgUrl = `url("${encodeURI(imagePath)}")`;2406 const imgUrl = `url("${encodeURI(imagePath)}")`;
2407 void eventSource.emit(event_types.FORCE_SET_BACKGROUND, { url: imgUrl, path: imagePath });2407 await eventSource.emit(event_types.FORCE_SET_BACKGROUND, { url: imgUrl, path: imagePath });
24082408
2409 if (typeof callbackOriginal === 'function') {2409 if (typeof callbackOriginal === 'function') {
2410 await callbackOriginal(prompt, imagePath, generationType, negativePromptPrefix, initiator, prefixedPrompt);2410 await callbackOriginal(prompt, imagePath, generationType, negativePromptPrefix, initiator, prefixedPrompt);