Don't auto-swipe on aborted stream
| @@ -3136,7 +3136,8 @@ class StreamingProcessor { | |||
| 3136 | 3136 | ||
| 3137 | //console.log("Generated text size:", text.length, text) | 3137 | //console.log("Generated text size:", text.length, text) |
| 3138 | 3138 | ||
| 3139 | if (power_user.auto_swipe) { | 3139 | const isAborted = this.abortController.signal.aborted; |
| 3140 | if (power_user.auto_swipe && !isAborted) { | ||
| 3140 | function containsBlacklistedWords(str, blacklist, threshold) { | 3141 | function containsBlacklistedWords(str, blacklist, threshold) { |
| 3141 | const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi'); | 3142 | const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi'); |
| 3142 | const matches = str.match(regex) || []; | 3143 | const matches = str.match(regex) || []; |
| @@ -4583,7 +4584,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 4583 | playMessageSound(); | 4584 | playMessageSound(); |
| 4584 | } | 4585 | } |
| 4585 | 4586 | ||
| 4586 | if (power_user.auto_swipe) { | 4587 | const isAborted = abortController && abortController.signal.aborted; |
| 4588 | if (power_user.auto_swipe && !isAborted) { | ||
| 4587 | console.debug('checking for autoswipeblacklist on non-streaming message'); | 4589 | console.debug('checking for autoswipeblacklist on non-streaming message'); |
| 4588 | function containsBlacklistedWords(getMessage, blacklist, threshold) { | 4590 | function containsBlacklistedWords(getMessage, blacklist, threshold) { |
| 4589 | console.debug('checking blacklisted words'); | 4591 | console.debug('checking blacklisted words'); |