Stop mass WI open if the page was unloaded

44c73354fda74741b1a4f98ffdc783dd21b14942

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

1 files changed, +7 -1Showing whitespace changes
public/scripts/world-info.js+7 -1
@@ -1943,12 +1943,15 @@ function updateWorldEntryKeyOptionsCache(keyOptions, { remove = false, reset = f
1943function clearEntryList($list) {1943function clearEntryList($list) {
1944 console.time('clearEntryList');1944 console.time('clearEntryList');
19451945
1946 // List already empty, skipping cleanup
1946 if (!$list.children().length) {1947 if (!$list.children().length) {
1947 console.debug('List already empty, skipping cleanup.');
1948 console.timeEnd('clearEntryList');1948 console.timeEnd('clearEntryList');
1949 return;1949 return;
1950 }1950 }
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
1952 // Step 1: Clean all <option> elements within <select>1955 // Step 1: Clean all <option> elements within <select>
1953 $list.find('option').each(function () {1956 $list.find('option').each(function () {
1954 const $option = $(this);1957 const $option = $(this);
@@ -2873,6 +2876,9 @@ function handleEntryKillSwitchHelper({ entryKillSwitch, entry, data, name, setWI
28732876
2874/**2877/**
2875 * Main function to build the WI entry editor template.2878 * 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.
2876 */2882 */
2877export async function getWorldEntry(name, data, entry) {2883export async function getWorldEntry(name, data, entry) {
2878 if (!data.entries[entry.uid]) return;2884 if (!data.entries[entry.uid]) return;