Don't auto-swipe on aborted stream

ef3cb73477439635f8e804ae1bc78af81013bf8c

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -2Ignore whitespace
public/script.js+4 -2
@@ -3143,7 +3143,8 @@ class StreamingProcessor {
31433143
31443144 //console.log("Generated text size:", text.length, text)
31453145
3146- if (power_user.auto_swipe) {
3146+ const isAborted = this.abortController.signal.aborted;
3147+ if (power_user.auto_swipe && !isAborted) {
31473148 function containsBlacklistedWords(str, blacklist, threshold) {
31483149 const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');
31493150 const matches = str.match(regex) || [];
@@ -4590,7 +4591,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
45904591 playMessageSound();
45914592 }
45924593
4593- if (power_user.auto_swipe) {
4594+ const isAborted = abortController && abortController.signal.aborted;
4595+ if (power_user.auto_swipe && !isAborted) {
45944596 console.debug('checking for autoswipeblacklist on non-streaming message');
45954597 function containsBlacklistedWords(getMessage, blacklist, threshold) {
45964598 console.debug('checking blacklisted words');