mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Fix endless animation if recaption is aborted
This commit is contained in:
parent
67d2bb9891
commit
8ce2af16fb
@ -520,12 +520,17 @@ jQuery(async function () {
|
|||||||
const messageImg = messageBlock.find('.mes_img');
|
const messageImg = messageBlock.find('.mes_img');
|
||||||
if (messageImg.hasClass(animationClass)) return;
|
if (messageImg.hasClass(animationClass)) return;
|
||||||
messageImg.addClass(animationClass);
|
messageImg.addClass(animationClass);
|
||||||
const index = Number(messageBlock.attr('mesid'));
|
try {
|
||||||
const data = getContext().chat[index];
|
const index = Number(messageBlock.attr('mesid'));
|
||||||
await captionExistingMessage(data);
|
const data = getContext().chat[index];
|
||||||
appendMediaToMessage(data, messageBlock, false);
|
await captionExistingMessage(data);
|
||||||
await saveChatConditional();
|
appendMediaToMessage(data, messageBlock, false);
|
||||||
messageImg.removeClass(animationClass);
|
await saveChatConditional();
|
||||||
|
} catch(e) {
|
||||||
|
console.error('Message image recaption failed', e);
|
||||||
|
} finally {
|
||||||
|
messageImg.removeClass(animationClass);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'caption',
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'caption',
|
||||||
|
Loading…
Reference in New Issue
Block a user