mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix duplicating entries if char and global WI are the same
This commit is contained in:
@@ -4806,7 +4806,8 @@ export function select_selected_character(chid) {
|
|||||||
$("#renameCharButton").css("display", "");
|
$("#renameCharButton").css("display", "");
|
||||||
$('.open_alternate_greetings').data('chid', chid);
|
$('.open_alternate_greetings').data('chid', chid);
|
||||||
$('#set_character_world').data('chid', chid);
|
$('#set_character_world').data('chid', chid);
|
||||||
$('#set_character_world').toggleClass('world_set', !!(characters[chid].data?.extensions?.world));
|
const world = characters[chid].data?.extensions?.world;
|
||||||
|
$('#set_character_world').toggleClass('world_set', world && world_names.includes(world));
|
||||||
|
|
||||||
$("#form_create").attr("actiontype", "editcharacter");
|
$("#form_create").attr("actiontype", "editcharacter");
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
@@ -555,8 +555,13 @@ async function getCharacterLore() {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name === world_info) {
|
||||||
|
console.debug(`Character ${characters[this_chid]?.name} world info is the same as global: ${name}. Skipping...`);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if (!world_names.includes(name)) {
|
if (!world_names.includes(name)) {
|
||||||
console.warn(`Character ${characters[this_chid]?.name} has invalid world info name: ${name}`);
|
console.log(`Character ${characters[this_chid]?.name} world info does not exist: ${name}`);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user