Hypothetical fix for random images

This commit is contained in:
Brandon Thomas committed 2022-10-19 00:46:37 -04:00
1 parent fd33b5b2b3
commit ea6a860b4f
1 file changed
+10 -10
@@ -1,4 +1,4 @@
import React, { useEffect, useCallback, useState } from "react";
import React, { useEffect, useCallback, useState, useMemo } from "react";
import { Link } from "react-router-dom";
import { SessionTtsInferenceResultListFc } from "../../_common/SessionTtsInferenceResultsListFc";
import { SessionTtsModelUploadResultListFc } from "../../_common/SessionTtsModelUploadResultsListFc";
@@ -109,6 +109,15 @@ 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(() => images[Math.floor(Math.random() * images.length)], []);
const [maybeTtsError, setMaybeTtsError] = useState<
GenerateTtsAudioErrorType | undefined
>(undefined);
@@ -321,15 +330,6 @@ function TtsModelListPage(props: Props) {
);
}
const images = [
"mascot/halloween_1.webp",
"mascot/halloween_2.webp",
"mascot/halloween_3.webp",
"mascot/kitsune_pose2.webp",
];
const randomImage = images[Math.floor(Math.random() * images.length)];
return (
<motion.div initial="hidden" animate="visible" variants={container}>
{bootstrapLanguageNotice}