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
3144 //console.log("Generated text size:", text.length, text)3144 //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) {
3147 function containsBlacklistedWords(str, blacklist, threshold) {3148 function containsBlacklistedWords(str, blacklist, threshold) {
3148 const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');3149 const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');
3149 const matches = str.match(regex) || [];3150 const matches = str.match(regex) || [];
@@ -4590,7 +4591,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4590 playMessageSound();4591 playMessageSound();
4591 }4592 }
45924593
4593 if (power_user.auto_swipe) {4594 const isAborted = abortController && abortController.signal.aborted;
4595 if (power_user.auto_swipe && !isAborted) {
4594 console.debug('checking for autoswipeblacklist on non-streaming message');4596 console.debug('checking for autoswipeblacklist on non-streaming message');
4595 function containsBlacklistedWords(getMessage, blacklist, threshold) {4597 function containsBlacklistedWords(getMessage, blacklist, threshold) {
4596 console.debug('checking blacklisted words');4598 console.debug('checking blacklisted words');