Move CHAT_CHANGED injects revive listener to initDefaultSlashCommands

f477ed1d74b0c9849ca1b418d196d77678a81713

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

2 files changed, +2 -3Ignore whitespace
public/script.js+1 -3
@@ -179,7 +179,7 @@ import {
179179import { debounce_timeout, IGNORE_SYMBOL } from './scripts/constants.js';
180180
181181import { cancelDebouncedMetadataSave, doDailyExtensionUpdatesCheck, extension_settings, initExtensions, loadExtensionSettings, runGenerationInterceptors, saveMetadataDebounced } from './scripts/extensions.js';
182182import { COMMENT_NAME_DEFAULT, CONNECT_API_MAP, executeSlashCommandsOnChatInput, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, stopScriptExecution, UNIQUE_APIS } from './scripts/slash-commands.js';
183183import {
184184 tag_map,
185185 tags,
@@ -423,8 +423,6 @@ export const event_types = {
423423
424424export const eventSource = new EventEmitter([event_types.APP_READY]);
425425
426-eventSource.on(event_types.CHAT_CHANGED, processChatSlashCommands);
427-
428426export const characterGroupOverlay = new BulkEditOverlay();
429427const characterContextMenu = new CharacterContextMenu(characterGroupOverlay);
430428eventSource.on(event_types.CHARACTER_PAGE_LOADED, characterGroupOverlay.onPageLoad);
public/scripts/slash-commands.js+1 -0
@@ -213,6 +213,7 @@ function setupConnectAPIMap() {
213213}
214214
215215export function initDefaultSlashCommands() {
216+ eventSource.on(event_types.CHAT_CHANGED, processChatSlashCommands);
216217 setupConnectAPIMap();
217218
218219 async function enableInstructCallback() {