mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 19:07:40 +01:00
don't let progress bar go backwards
This commit is contained in:
parent
646f77f9f8
commit
b7e8f8faaa
@ -3499,16 +3499,16 @@ export async function executeSlashCommandsOnChatInput(text, options = {}) {
|
||||
|
||||
/**@type {SlashCommandClosureResult} */
|
||||
let result = null;
|
||||
let currentProgress = '';
|
||||
let currentProgress = 0;
|
||||
try {
|
||||
commandsFromChatInputAbortController = new SlashCommandAbortController();
|
||||
result = await executeSlashCommandsWithOptions(text, {
|
||||
abortController: commandsFromChatInputAbortController,
|
||||
onProgress: (done, total) => {
|
||||
const newProgress = `${done / total * 100}%`;
|
||||
if (newProgress !== currentProgress) {
|
||||
const newProgress = done / total;
|
||||
if (newProgress > currentProgress) {
|
||||
currentProgress = newProgress;
|
||||
ta.style.setProperty('--prog', newProgress);
|
||||
ta.style.setProperty('--prog', `${newProgress * 100}%`);
|
||||
}
|
||||
},
|
||||
parserFlags: options.parserFlags,
|
||||
|
Loading…
x
Reference in New Issue
Block a user