mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
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:
@ -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();
|
||||||
|
@ -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.
|
||||||
|
Reference in New Issue
Block a user