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

470a0964f7be9a433a7385f145f2d13927f3662c

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +4 -3Ignore whitespace
public/script.js+2 -0
@@ -50,6 +50,7 @@ import {
5050 importWorldInfo,
5151 wi_anchor_position,
5252 world_info_include_names,
53+ initWorldInfo,
5354} from './scripts/world-info.js';
5455
5556import {
@@ -992,6 +993,7 @@ async function firstLoadInit() {
992993 initBackgrounds();
993994 initAuthorsNote();
994995 await initPersonas();
996+ initWorldInfo();
995997 initRossMods();
996998 initStats();
997999 initCfg();
public/scripts/world-info.js+2 -3
@@ -5160,8 +5160,7 @@ export async function assignLorebookToChat(event) {
51605160 return callGenericPopup(template, POPUP_TYPE.TEXT);
51615161}
51625162
5163-jQuery(() => {
5163+export function initWorldInfo() {
5164-
51655164 $('#world_info').on('mousedown change', async function (e) {
51665165 // If there's no world names, don't do anything
51675166 if (world_names.length === 0) {
@@ -5373,7 +5372,7 @@ jQuery(() => {
53735372 }
53745373 });
53755374 });
53765375});
53775376
53785377/**
53795378 * Moves a World Info entry from a source lorebook to a target lorebook.