From 4d3661c1882f3d049abb8ff10b205cb75326b9ae Mon Sep 17 00:00:00 2001 From: Sj-Si Date: Mon, 15 Apr 2024 10:48:28 -0400 Subject: [PATCH] fix bug --- javascript/extraNetworks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index 540ad5956..4b81b0cb4 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -462,10 +462,10 @@ function extraNetworksRemoveFromPrompt(textarea, text, is_neg) { }, ); if (idx >= 0) { - if (postfix && res.slice(idx, postfix.length) === postfix) { + if (postfix && res.slice(idx, idx + postfix.length) === postfix) { res = res.slice(0, idx) + res.slice(idx + postfix.length); } - if (res.slice(idx - prefix.length, prefix.length) === prefix) { + if (res.slice(idx - prefix.length, idx) === prefix) { res = res.slice(0, idx - prefix.length) + res.slice(idx); } }