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:
RossAscends
2025-06-05 16:13:27 +09:00
parent 42b2637707
commit e1a1fdb0da

View File

@@ -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 });
} }