mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix ephemeral injects clean-up
This commit is contained in:
@ -1212,9 +1212,16 @@ function injectCallback(args, value) {
|
||||
saveMetadataDebounced();
|
||||
|
||||
if (ephemeral) {
|
||||
let deleted = false;
|
||||
const unsetInject = () => {
|
||||
if (deleted) {
|
||||
return;
|
||||
}
|
||||
console.log('Removing ephemeral script injection', id);
|
||||
delete chat_metadata.script_injects[id];
|
||||
setExtensionPrompt(prefixedId, '', position, depth, scan, role);
|
||||
saveMetadataDebounced();
|
||||
deleted = true;
|
||||
};
|
||||
eventSource.once(event_types.GENERATION_ENDED, unsetInject);
|
||||
eventSource.once(event_types.GENERATION_STOPPED, unsetInject);
|
||||
|
Reference in New Issue
Block a user