Stop mass WI open if the page was unloaded

44c73354fda74741b1a4f98ffdc783dd21b14942

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +7 -1Ignore whitespace
public/scripts/world-info.js+7 -1
@@ -1943,12 +1943,15 @@ function updateWorldEntryKeyOptionsCache(keyOptions, { remove = false, reset = f
19431943function clearEntryList($list) {
19441944 console.time('clearEntryList');
19451945
1946+ // List already empty, skipping cleanup
19461947 if (!$list.children().length) {
1947- console.debug('List already empty, skipping cleanup.');
19481948 console.timeEnd('clearEntryList');
19491949 return;
19501950 }
19511951
1952+ // Unsubscribe from toggle events, so that mass open won't create new drawers
1953+ $list.find('.inline-drawer').off('inline-drawer-toggle');
1954+
19521955 // Step 1: Clean all <option> elements within <select>
19531956 $list.find('option').each(function () {
19541957 const $option = $(this);
@@ -2873,6 +2876,9 @@ function handleEntryKillSwitchHelper({ entryKillSwitch, entry, data, name, setWI
28732876
28742877/**
28752878 * Main function to build the WI entry editor template.
2879+ * @param {string} name - The name of the world info file.
2880+ * @param {object} data - The world info data object.
2881+ * @param {object} entry - The entry object to be edited.
28762882 */
28772883export async function getWorldEntry(name, data, entry) {
28782884 if (!data.entries[entry.uid]) return;