From a1e28fe6472cd4c7c89f3caa9bb596edceaa290b Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:46:28 +0800 Subject: [PATCH] TootComposer: fix placeholder empty --- src/timelines/TootComposer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timelines/TootComposer.tsx b/src/timelines/TootComposer.tsx index 8e4ed25..b50ba64 100644 --- a/src/timelines/TootComposer.tsx +++ b/src/timelines/TootComposer.tsx @@ -183,7 +183,8 @@ function randomChoose( rn: number, K: T, ): T extends Array ? 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]; }