WI entry update slash commands use debounced - WI entry updates utilize debounced save - Trade-off between consistency of possible data loss and performance issues in STscript loops that update multiple things in a WI file are not worth it.

0975843f1de69783247794dfa55e0d669854a6b7

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +5 -5Showing whitespace changes
public/scripts/world-info.js+5 -5
@@ -1057,7 +1057,7 @@ function registerWorldInfoSlashCommands() {
10571057 entry.content = content;
10581058 }
10591059
10601060 await saveWorldInfo(file, data, true);
10611061 reloadEditor(file);
10621062
10631063 return String(entry.uid);
@@ -1108,7 +1108,7 @@ function registerWorldInfoSlashCommands() {
11081108 setOriginalDataValue(data, uid, originalDataKeyMap[field], entry[field]);
11091109 }
11101110
11111111 await saveWorldInfo(file, data, true);
11121112 reloadEditor(file);
11131113 return '';
11141114 }
@@ -1934,7 +1934,7 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
19341934
19351935 if (counter > 0) {
19361936 toastr.info(`Backfilled ${counter} titles`);
19371937 await saveWorldInfo(name, data, true);
19381938 updateEditor(navigation_option.previous);
19391939 }
19401940 });
@@ -1994,7 +1994,7 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
19941994
19951995 console.table(Object.keys(data.entries).map(uid => data.entries[uid]).map(x => ({ uid: x.uid, key: x.key.join(','), displayIndex: x.displayIndex })));
19961996
19971997 await saveWorldInfo(name, data, true);
19981998 },
19991999 });
20002000 //$("#world_popup_entries_list").disableSelection();
@@ -3277,7 +3277,7 @@ async function _save(name, data) {
32773277 eventSource.emit(event_types.WORLDINFO_UPDATED, name, data);
32783278}
32793279
32803280async function saveWorldInfo(name, data, immediately = false) {
32813281 if (!name || !data) {
32823282 return;
32833283 }