rolexx commited on
Commit
54740d5
·
1 Parent(s): f0da953
src/components/court/Court.tsx CHANGED
@@ -25,13 +25,7 @@ const CourtScene: FC<CourtSceneProps> = ({
25
  if (isPlayingRef.current || !currentQuestion) return;
26
 
27
  try {
28
- isPlayingRef.current = true;
29
-
30
- if (audioRef.current) {
31
- audioRef.current.pause();
32
- audioRef.current = null;
33
- }
34
-
35
  const response = await fetch('/api/voice', {
36
  method: 'POST',
37
  headers: {
 
25
  if (isPlayingRef.current || !currentQuestion) return;
26
 
27
  try {
28
+ isPlayingRef.current = true;
 
 
 
 
 
 
29
  const response = await fetch('/api/voice', {
30
  method: 'POST',
31
  headers: {
src/components/end/End.tsx CHANGED
@@ -29,11 +29,6 @@ const EndScene: FC<EndSceneProps> = ({
29
 
30
  const playVerdict = async () => {
31
  try {
32
- if (audioRef.current) {
33
- audioRef.current.pause();
34
- audioRef.current = null;
35
- }
36
-
37
  const response = await fetch('/api/voice', {
38
  method: 'POST',
39
  headers: {
@@ -58,7 +53,7 @@ const EndScene: FC<EndSceneProps> = ({
58
  audioRef.current.pause();
59
  audioRef.current = null;
60
  }
61
-
62
  const audio = new Audio(audioUrl);
63
  audioRef.current = audio;
64
  await audio.play();
 
29
 
30
  const playVerdict = async () => {
31
  try {
 
 
 
 
 
32
  const response = await fetch('/api/voice', {
33
  method: 'POST',
34
  headers: {
 
53
  audioRef.current.pause();
54
  audioRef.current = null;
55
  }
56
+
57
  const audio = new Audio(audioUrl);
58
  audioRef.current = audio;
59
  await audio.play();