fix: updated from 9.3.3 to 15

This commit is contained in:
2026-05-19 20:22:37 +01:00
parent 27806f438f
commit 8589c83fb8
18 changed files with 45 additions and 76 deletions
+16 -5
View File
@@ -1,6 +1,5 @@
'use client';
import Image from "next/image";
import { useState, useRef, useEffect, MouseEvent } from 'react';
// Configuration
@@ -113,8 +112,20 @@ export default function MusicPage() {
};
useEffect(() => {
void fetchTracks();
}, []);
let active = true;
const run = async () => {
const data = await fetchTracks();
if (!active) return;
setTracks(data);
};
void run();
return () => {
active = false;
};
}, [isPlaying]);
// Group tracks by theme
const tracksByTheme = tracks.reduce<Record<string, Track[]>>((acc, track) => {
@@ -338,7 +349,7 @@ export default function MusicPage() {
<div className="border border-white/10 bg-black overflow-hidden">
{isVideo ? (
<video
ref={mediaRef as any}
ref={mediaRef as unknown}
onTimeUpdate={handleTimeUpdate}
onEnded={nextTrack}
onPlay={() => setIsPlaying(true)}
@@ -379,7 +390,7 @@ export default function MusicPage() {
{/* Audio element (hidden) */}
<audio
ref={mediaRef as any}
ref={mediaRef as unknown}
onTimeUpdate={handleTimeUpdate}
onEnded={nextTrack}
onPlay={() => setIsPlaying(true)}