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 -3Showing whitespace changes
public/script.js+2 -0
@@ -50,6 +50,7 @@ import {
50 importWorldInfo,50 importWorldInfo,
51 wi_anchor_position,51 wi_anchor_position,
52 world_info_include_names,52 world_info_include_names,
53 initWorldInfo,
53} from './scripts/world-info.js';54} from './scripts/world-info.js';
5455
55import {56import {
@@ -992,6 +993,7 @@ async function firstLoadInit() {
992 initBackgrounds();993 initBackgrounds();
993 initAuthorsNote();994 initAuthorsNote();
994 await initPersonas();995 await initPersonas();
996 initWorldInfo();
995 initRossMods();997 initRossMods();
996 initStats();998 initStats();
997 initCfg();999 initCfg();
public/scripts/world-info.js+2 -3
@@ -5160,8 +5160,7 @@ export async function assignLorebookToChat(event) {
5160 return callGenericPopup(template, POPUP_TYPE.TEXT);5160 return callGenericPopup(template, POPUP_TYPE.TEXT);
5161}5161}
51625162
5163jQuery(() => {5163export function initWorldInfo() {
5164
5165 $('#world_info').on('mousedown change', async function (e) {5164 $('#world_info').on('mousedown change', async function (e) {
5166 // If there's no world names, don't do anything5165 // If there's no world names, don't do anything
5167 if (world_names.length === 0) {5166 if (world_names.length === 0) {
@@ -5373,7 +5372,7 @@ jQuery(() => {
5373 }5372 }
5374 });5373 });
5375 });5374 });
5376});5375}
53775376
5378/**5377/**
5379 * Moves a World Info entry from a source lorebook to a target lorebook.5378 * Moves a World Info entry from a source lorebook to a target lorebook.