Try to preserve old hashes

34b2707895daa74d256ba95081d308a7f6098369

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

1 files changed, +5 -3Ignore whitespace
public/scripts/world-info.js+5 -3
@@ -3592,11 +3592,13 @@ export async function getSortedEntries() {
35923592 // Chat lore always goes first
35933593 entries = [...chatLore.sort(sortFn), ...entries];
35943594
35953595 // Calculate hash and parse decorators. Split maps to preserve old hashes.
35963596 entries = entries.map((entry) => {
3597- const hash = getStringHash(JSON.stringify(entry));
35983597 const [decorators, content] = parseDecorators(entry.content || '');
35993598 return { ...entry, decorators, content, hash };
3599+ }).map((entry) => {
3600+ const hash = getStringHash(JSON.stringify(entry));
3601+ return { ...entry, hash };
36003602 });
36013603
36023604 console.debug(`[WI] Found ${entries.length} world lore entries. Sorted by strategy`, Object.entries(world_info_insertion_strategy).find((x) => x[1] === world_info_character_strategy));