TootComposer: fix placeholder empty

This commit is contained in:
thislight 2024-09-28 22:46:28 +08:00
parent 63603e049d
commit d90876a84e
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E

View file

@ -183,7 +183,8 @@ function randomChoose<T extends any[]>(
rn: number,
K: T,
): T extends Array<infer E> ? E : never {
const idx = Math.round(rn * K.length) - 1;
const idx = Math.floor(rn * K.length);
console.log(idx, K.length);
return K[idx];
}