Use init function

This commit is contained in:
Cohee 2024-09-19 23:59:58 +03:00
parent 1e5149f209
commit 1dd3be9479
2 changed files with 4 additions and 2 deletions

View File

@ -244,6 +244,7 @@ import { SlashCommandEnumValue, enumTypes } from './scripts/slash-commands/Slash
import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js'; import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js';
import { initInputMarkdown } from './scripts/input-md-formatting.js'; import { initInputMarkdown } from './scripts/input-md-formatting.js';
import { AbortReason } from './scripts/util/AbortReason.js'; import { AbortReason } from './scripts/util/AbortReason.js';
import { initSystemPrompts } from './scripts/sysprompt.js';
//exporting functions and vars for mods //exporting functions and vars for mods
export { export {
@ -932,6 +933,7 @@ async function firstLoadInit() {
initLocales(); initLocales();
initDefaultSlashCommands(); initDefaultSlashCommands();
initTextGenModels(); initTextGenModels();
initSystemPrompts();
await getSystemMessages(); await getSystemMessages();
sendSystemMessage(system_message_types.WELCOME); sendSystemMessage(system_message_types.WELCOME);
sendSystemMessage(system_message_types.WELCOME_PROMPT); sendSystemMessage(system_message_types.WELCOME_PROMPT);

View File

@ -137,7 +137,7 @@ function selectSystemPromptCallback(args, name) {
return foundName; return foundName;
} }
jQuery(function () { export function initSystemPrompts() {
$enabled.on('input', function () { $enabled.on('input', function () {
power_user.sysprompt.enabled = !!$(this).prop('checked'); power_user.sysprompt.enabled = !!$(this).prop('checked');
toggleSystemPromptDisabledControls(); toggleSystemPromptDisabledControls();
@ -236,4 +236,4 @@ jQuery(function () {
], ],
callback: toggleSystemPromptCallback, callback: toggleSystemPromptCallback,
})); }));
}); }