Fix bug when only global bans are defined

c37c9051a62abc18d7f873dd010ac0ab4981e492

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

1 files changed, +3 -3Ignore whitespace
public/scripts/textgen-settings.js+3 -3
@@ -399,7 +399,7 @@ function getTokenizerForTokenIds() {
399 * @returns {TokenBanResult} String with comma-separated banned token IDs399 * @returns {TokenBanResult} String with comma-separated banned token IDs
400 */400 */
401function getCustomTokenBans() {401function getCustomTokenBans() {
402 if (!settings.send_banned_tokens || (!settings.banned_tokens && !textgenerationwebui_banned_in_macros.length)) {402 if (!settings.send_banned_tokens || (!settings.banned_tokens && !settings.global_banned_tokens && !textgenerationwebui_banned_in_macros.length)) {
403 return {403 return {
404 banned_tokens: '',404 banned_tokens: '',
405 banned_strings: [],405 banned_strings: [],
@@ -460,7 +460,7 @@ function getCustomTokenBans() {
460460
461async function enableBannedStringsKillSwitch() {461async function enableBannedStringsKillSwitch() {
462 $('#send_banned_tokens_textgenerationwebui').prop('checked', true);462 $('#send_banned_tokens_textgenerationwebui').prop('checked', true);
463 $('#send_banned_tokens_label').find('.menu_button').addClass('toggleEnabled').prop('title', t`Banned tokens/strings are being sent into the request.`);463 $('#send_banned_tokens_label').find('.menu_button').addClass('toggleEnabled').prop('title', t`Banned tokens/strings are being sent in the request.`);
464 settings.send_banned_tokens = true;464 settings.send_banned_tokens = true;
465 saveSettingsDebounced();465 saveSettingsDebounced();
466 return '';466 return '';
@@ -468,7 +468,7 @@ async function enableBannedStringsKillSwitch() {
468468
469async function disableBannedStringsKillSwitch() {469async function disableBannedStringsKillSwitch() {
470 $('#send_banned_tokens_textgenerationwebui').prop('checked', false);470 $('#send_banned_tokens_textgenerationwebui').prop('checked', false);
471 $('#send_banned_tokens_label').find('.menu_button').removeClass('toggleEnabled').prop('title', t`Banned tokens/strings are NOT being sent into the request.`);471 $('#send_banned_tokens_label').find('.menu_button').removeClass('toggleEnabled').prop('title', t`Banned tokens/strings are NOT being sent in the request.`);
472 settings.send_banned_tokens = false;472 settings.send_banned_tokens = false;
473 saveSettingsDebounced();473 saveSettingsDebounced();
474 return '';474 return '';