From 8a6f6c243d15d67cf94549ce6f5736b9a20c037e Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 19 Oct 2022 01:04:15 -0400 Subject: [PATCH] Fix build errors --- .../view/tts/tts_model_list/TtsModelListPage.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx b/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx index 66c9d492e0..5e521aa1d6 100644 --- a/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx +++ b/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx @@ -109,14 +109,16 @@ function TtsModelListPage(props: Props) { setMaybeSelectedTtsModel, } = props; - const images = [ - "mascot/halloween_1.webp", - "mascot/halloween_2.webp", - "mascot/halloween_3.webp", - "mascot/kitsune_pose2.webp", - ]; + const randomImage = useMemo(() => { + const images = [ + "mascot/halloween_1.webp", + "mascot/halloween_2.webp", + "mascot/halloween_3.webp", + "mascot/kitsune_pose2.webp", + ]; - const randomImage = useMemo(() => images[Math.floor(Math.random() * images.length)], []); + return images[Math.floor(Math.random() * images.length)]; + }, []); const [maybeTtsError, setMaybeTtsError] = useState< GenerateTtsAudioErrorType | undefined