mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Update world-info.js
- make the rename button is also available in case of WIbook corruption. - make the WI engine doesn't crash when certain entrys with `content === null`.
This commit is contained in:
@@ -1761,8 +1761,11 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
|
||||
return;
|
||||
}
|
||||
|
||||
// Regardless of whether success is displayed or not. Make sure the delete button is available.
|
||||
// Regardless of whether success is displayed or not. Make sure the delete/rename button is available.
|
||||
// Do not put this code behind.
|
||||
$('#world_popup_name_button').off('click').on('click', async () => {
|
||||
await renameWorldInfo(name, data);
|
||||
});
|
||||
$('#world_popup_delete').off('click').on('click', async () => {
|
||||
const confirmation = await Popup.show.confirm(`Delete the World/Lorebook: "${name}"?`, 'This action is irreversible!');
|
||||
if (!confirmation) {
|
||||
@@ -1910,10 +1913,6 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
|
||||
if (entry) updateEditor(entry.uid);
|
||||
});
|
||||
|
||||
$('#world_popup_name_button').off('click').on('click', async () => {
|
||||
await renameWorldInfo(name, data);
|
||||
});
|
||||
|
||||
$('#world_backfill_memos').off('click').on('click', async () => {
|
||||
let counter = 0;
|
||||
for (const entry of Object.values(data.entries)) {
|
||||
@@ -3584,7 +3583,7 @@ export async function getSortedEntries() {
|
||||
|
||||
// Parse decorators
|
||||
entries = entries.map((entry) => {
|
||||
const [decorators, content] = parseDecorators(entry.content);
|
||||
const [decorators, content] = parseDecorators(entry.content || '');
|
||||
return { ...entry, decorators, content };
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user