Don't change active WI selection on import

This commit is contained in:
Cohee
2023-06-21 12:23:14 +03:00
parent 23a6064a55
commit 012f0237db

View File

@@ -136,7 +136,7 @@ async function loadWorldInfoData(name) {
return null; return null;
} }
async function updateWorldInfoList(importedWorldName) { async function updateWorldInfoList() {
var result = await fetch("/getsettings", { var result = await fetch("/getsettings", {
method: "POST", method: "POST",
headers: getRequestHeaders(), headers: getRequestHeaders(),
@@ -153,11 +153,6 @@ async function updateWorldInfoList(importedWorldName) {
$("#world_info").append(`<option value='${i}'>${item}</option>`); $("#world_info").append(`<option value='${i}'>${item}</option>`);
$("#world_editor_select").append(`<option value='${i}'>${item}</option>`); $("#world_editor_select").append(`<option value='${i}'>${item}</option>`);
}); });
if (importedWorldName) {
const indexOf = world_names.indexOf(world_info);
$("#world_info").val(indexOf);
}
} }
} }
@@ -831,7 +826,7 @@ jQuery(() => {
processData: false, processData: false,
success: async function (data) { success: async function (data) {
if (data.name) { if (data.name) {
await updateWorldInfoList(data.name); await updateWorldInfoList();
const newIndex = world_names.indexOf(data.name); const newIndex = world_names.indexOf(data.name);
if (newIndex >= 0) { if (newIndex >= 0) {