Fix legacy picks

6a5828f2c78741abe723805143aa0dc607171df0

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

1 files changed, +2 -1Showing whitespace changes
public/scripts/macros.js+2 -1
@@ -359,7 +359,8 @@ function pickReplace(input, rawContent, emptyListPlaceholder = '') {
359 // We build a hash seed based on: unique chat file, raw content, and the placement inside this content359 // We build a hash seed based on: unique chat file, raw content, and the placement inside this content
360 // This allows us to get unique but repeatable picks in nearly all cases360 // This allows us to get unique but repeatable picks in nearly all cases
361 const combinedSeedString = `${chatIdHash}-${rawContentHash}-${offset}`;361 const combinedSeedString = `${chatIdHash}-${rawContentHash}-${offset}`;
362 const finalSeed = getStringHash(combinedSeedString).toString();362 const finalSeed = getStringHash(combinedSeedString);
363 // @ts-ignore - have to use numbers for legacy picks
363 const rng = seedrandom(finalSeed);364 const rng = seedrandom(finalSeed);
364 const randomIndex = Math.floor(rng() * list.length);365 const randomIndex = Math.floor(rng() * list.length);
365 return list[randomIndex];366 return list[randomIndex];