voice token not being set bug fix

This commit is contained in:
bflatastic committed 2024-09-09 12:28:17 +07:00
1 parent c97574c059
commit c4a28814d3
1 file changed
+7 -1
@@ -43,7 +43,7 @@ export const GenerateTts = ({
const [isPlaying, setIsPlaying] = useState(false);
const [jobToken, setJobToken] = useState<string | null>(null);
const [isAudioLoading, setIsAudioLoading] = useState(false);
const [voiceToken] = useState(
const [voiceToken, setVoiceToken] = useState(
weightToken || "weight_hz7g8f1j4psrsw2sv67e4y61q"
);
const [progress, setProgress] = useState(0);
@@ -228,6 +228,12 @@ export const GenerateTts = ({
}
}
useEffect(() => {
if (weightToken) {
setVoiceToken(weightToken);
}
}, [weightToken]);
return (
<>
<div>