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