Fix first reorder of group VN with reduced motion
| @@ -4,7 +4,7 @@ import { characters, eventSource, event_types, generateRaw, getRequestHeaders, m | |||
| 4 | import { dragElement, isMobile } from '../../RossAscends-mods.js'; | 4 | import { dragElement, isMobile } from '../../RossAscends-mods.js'; |
| 5 | import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js'; | 5 | import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js'; |
| 6 | import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js'; | 6 | import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js'; |
| 7 | import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar } from '../../utils.js'; | 7 | import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, delay } from '../../utils.js'; |
| 8 | import { hideMutedSprites, selected_group } from '../../group-chats.js'; | 8 | import { hideMutedSprites, selected_group } from '../../group-chats.js'; |
| 9 | import { isJsonSchemaSupported } from '../../textgen-settings.js'; | 9 | import { isJsonSchemaSupported } from '../../textgen-settings.js'; |
| 10 | import { debounce_timeout } from '../../constants.js'; | 10 | import { debounce_timeout } from '../../constants.js'; |
| @@ -345,6 +345,12 @@ async function visualNovelUpdateLayers(container) { | |||
| 345 | await Promise.allSettled(setLayerIndicesPromises); | 345 | await Promise.allSettled(setLayerIndicesPromises); |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 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 | */ | ||
| 348 | async function setImage(img, path) { | 354 | async function setImage(img, path) { |
| 349 | // Cohee: If something goes wrong, uncomment this to return to the old behavior | 355 | // Cohee: If something goes wrong, uncomment this to return to the old behavior |
| 350 | /* | 356 | /* |
| @@ -412,7 +418,9 @@ async function setImage(img, path) { | |||
| 412 | expressionHolder.css('min-width', 100); | 418 | expressionHolder.css('min-width', 100); |
| 413 | expressionHolder.css('min-height', 100); | 419 | expressionHolder.css('min-height', 100); |
| 414 | 420 | ||
| 415 | resolve(); | 421 | expressionClone.one('load', function () { |
| 422 | resolve(); | ||
| 423 | }); | ||
| 416 | }); | 424 | }); |
| 417 | 425 | ||
| 418 | expressionClone.removeClass('expression-clone'); | 426 | expressionClone.removeClass('expression-clone'); |