mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
dont reload editor list on world list tag click if that world is already displayed and open in the editor
This commit is contained in:
@@ -5631,9 +5631,12 @@ export function initWorldInfo() {
|
|||||||
select2ChoiceClickSubscribe($('#world_info'), target => {
|
select2ChoiceClickSubscribe($('#world_info'), target => {
|
||||||
const name = $(target).text();
|
const name = $(target).text();
|
||||||
const selectedIndex = world_names.indexOf(name);
|
const selectedIndex = world_names.indexOf(name);
|
||||||
if (selectedIndex !== -1) {
|
const alreadySelectedInEditor = $('#world_editor_select option:selected').text() === name;
|
||||||
|
if (selectedIndex !== -1 && !alreadySelectedInEditor) {
|
||||||
$('#world_editor_select').val(selectedIndex).trigger('change');
|
$('#world_editor_select').val(selectedIndex).trigger('change');
|
||||||
console.log('Quick selection of world', name);
|
console.log('Quick selection of world', name);
|
||||||
|
} else {
|
||||||
|
console.warn('lets not reload an already loaded list yes?');
|
||||||
}
|
}
|
||||||
}, { buttonStyle: true, closeDrawer: true });
|
}, { buttonStyle: true, closeDrawer: true });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user