Fix default value for filter argument

2e936e804a2f18f2412c3f52402ac2623ef99ad5

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +4 -4Ignore whitespace
public/scripts/extensions/expressions/index.js+4 -4
@@ -4,7 +4,7 @@ import { characters, eventSource, event_types, generateRaw, getRequestHeaders, m
4import { dragElement, isMobile } from '../../RossAscends-mods.js';4import { dragElement, isMobile } from '../../RossAscends-mods.js';
5import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js';5import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js';
6import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js';6import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js';
7import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, isTrueBoolean } from '../../utils.js';7import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, isFalseBoolean } from '../../utils.js';
8import { hideMutedSprites, selected_group } from '../../group-chats.js';8import { hideMutedSprites, selected_group } from '../../group-chats.js';
9import { isJsonSchemaSupported } from '../../textgen-settings.js';9import { isJsonSchemaSupported } from '../../textgen-settings.js';
10import { debounce_timeout } from '../../constants.js';10import { debounce_timeout } from '../../constants.js';
@@ -689,7 +689,7 @@ async function classifyCallback(/** @type {{api: string?, filter: string?, promp
689 }689 }
690690
691 const expressionApi = EXPRESSION_API[api] || extension_settings.expressions.api;691 const expressionApi = EXPRESSION_API[api] || extension_settings.expressions.api;
692 const filterAvailable = isTrueBoolean(filter);692 const filterAvailable = !isFalseBoolean(filter);
693693
694 if (!modules.includes('classify') && expressionApi == EXPRESSION_API.extras) {694 if (!modules.includes('classify') && expressionApi == EXPRESSION_API.extras) {
695 toastr.warning('Text classification is disabled or not available');695 toastr.warning('Text classification is disabled or not available');
@@ -2303,13 +2303,13 @@ function migrateSettings() {
2303 SlashCommandParser.addCommandObject(SlashCommand.fromProps({2303 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2304 name: 'expression-list',2304 name: 'expression-list',
2305 aliases: ['expressions'],2305 aliases: ['expressions'],
2306 /** @type {(args: {return: string, filterAvailable: string}) => Promise<string>} */2306 /** @type {(args: {return: string, filter: string}) => Promise<string>} */
2307 callback: async (args) => {2307 callback: async (args) => {
2308 let returnType =2308 let returnType =
2309 /** @type {import('../../slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */2309 /** @type {import('../../slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */
2310 (args.return);2310 (args.return);
23112311
2312 const list = await getExpressionsList({ filterAvailable: isTrueBoolean(args.filterAvailable) });2312 const list = await getExpressionsList({ filterAvailable: !isFalseBoolean(args.filter) });
23132313
2314 return await slashCommandReturnHelper.doReturn(returnType ?? 'pipe', list, { objectToStringFunc: list => list.join(', ') });2314 return await slashCommandReturnHelper.doReturn(returnType ?? 'pipe', list, { objectToStringFunc: list => list.join(', ') });
2315 },2315 },