Initialize world info during app startup

Moves world info event binding from jQuery document-ready handler
to explicit initialization function for better control flow
Ensures world info setup occurs after core dependencies are loaded
This commit is contained in:
Wolfsblvt
2025-04-25 20:43:13 +02:00
parent 74f441d0ba
commit 470a0964f7
2 changed files with 4 additions and 3 deletions

View File

@ -50,6 +50,7 @@ import {
importWorldInfo, importWorldInfo,
wi_anchor_position, wi_anchor_position,
world_info_include_names, world_info_include_names,
initWorldInfo,
} from './scripts/world-info.js'; } from './scripts/world-info.js';
import { import {
@ -992,6 +993,7 @@ async function firstLoadInit() {
initBackgrounds(); initBackgrounds();
initAuthorsNote(); initAuthorsNote();
await initPersonas(); await initPersonas();
initWorldInfo();
initRossMods(); initRossMods();
initStats(); initStats();
initCfg(); initCfg();

View File

@ -5160,8 +5160,7 @@ export async function assignLorebookToChat(event) {
return callGenericPopup(template, POPUP_TYPE.TEXT); return callGenericPopup(template, POPUP_TYPE.TEXT);
} }
jQuery(() => { export function initWorldInfo() {
$('#world_info').on('mousedown change', async function (e) { $('#world_info').on('mousedown change', async function (e) {
// If there's no world names, don't do anything // If there's no world names, don't do anything
if (world_names.length === 0) { if (world_names.length === 0) {
@ -5373,7 +5372,7 @@ jQuery(() => {
} }
}); });
}); });
}); }
/** /**
* Moves a World Info entry from a source lorebook to a target lorebook. * Moves a World Info entry from a source lorebook to a target lorebook.