Fix first reorder of group VN with reduced motion

aca1cb7f9973683beba19e2f3f9264af30c93e6b

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

1 files changed, +10 -2Ignore whitespace
public/scripts/extensions/expressions/index.js+10 -2
@@ -4,7 +4,7 @@ import { characters, eventSource, event_types, generateRaw, getRequestHeaders, m
44import { dragElement, isMobile } from '../../RossAscends-mods.js';
55import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js';
66import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js';
77import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, delay } from '../../utils.js';
88import { hideMutedSprites, selected_group } from '../../group-chats.js';
99import { isJsonSchemaSupported } from '../../textgen-settings.js';
1010import { debounce_timeout } from '../../constants.js';
@@ -345,6 +345,12 @@ async function visualNovelUpdateLayers(container) {
345345 await Promise.allSettled(setLayerIndicesPromises);
346346}
347347
348+/**
349+ * Sets the expression for the given character image.
350+ * @param {JQuery<HTMLElement>} img - The image element to set the image on
351+ * @param {string} path - The path to the image
352+ * @returns {Promise<void>} - A promise that resolves when the image is set
353+ */
348354async function setImage(img, path) {
349355 // Cohee: If something goes wrong, uncomment this to return to the old behavior
350356 /*
@@ -412,7 +418,9 @@ async function setImage(img, path) {
412418 expressionHolder.css('min-width', 100);
413419 expressionHolder.css('min-height', 100);
414420
415- resolve();
421+ expressionClone.one('load', function () {
422+ resolve();
423+ });
416424 });
417425
418426 expressionClone.removeClass('expression-clone');