mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Compatibility with extensions
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { eventSource, event_types } from '../script.js';
|
||||
import { power_user } from './power-user.js';
|
||||
import { delay } from './utils.js';
|
||||
|
||||
@ -257,6 +258,7 @@ export class SmoothEventSourceStream extends EventSourceStream {
|
||||
hasFocus && await delay(getDelay(lastStr));
|
||||
controller.enqueue(new MessageEvent(event.type, { data: JSON.stringify(parsed.data) }));
|
||||
lastStr = parsed.chunk;
|
||||
hasFocus && await eventSource.emit(event_types.SMOOTH_STREAM_TOKEN_RECEIVED, parsed.chunk);
|
||||
}
|
||||
} catch {
|
||||
controller.enqueue(event);
|
||||
|
Reference in New Issue
Block a user