Fix legacy picks

This commit is contained in:
Cohee 2024-10-18 08:44:54 +00:00
parent f918b146e7
commit 6a5828f2c7
1 changed files with 2 additions and 1 deletions

View File

@ -359,7 +359,8 @@ function pickReplace(input, rawContent, emptyListPlaceholder = '') {
// We build a hash seed based on: unique chat file, raw content, and the placement inside this content
// This allows us to get unique but repeatable picks in nearly all cases
const combinedSeedString = `${chatIdHash}-${rawContentHash}-${offset}`;
const finalSeed = getStringHash(combinedSeedString).toString();
const finalSeed = getStringHash(combinedSeedString);
// @ts-ignore - have to use numbers for legacy picks
const rng = seedrandom(finalSeed);
const randomIndex = Math.floor(rng() * list.length);
return list[randomIndex];