fix
All checks were successful
CI / Maven unit tests (push) Successful in 15s
CI / Build and push images (push) Has been skipped
CI / Deploy to server (push) Has been skipped

This commit is contained in:
2026-10-17 22:15:26 +01:00
parent 2818d33dd5
commit 5ddd3144cc
2 changed files with 8 additions and 4 deletions

View File

@@ -7,12 +7,14 @@ import type { Clip } from "../utils/types";
const MyClips = () => {
const [clips, setClips] = useState<Clip[]>([]);
const [error, setError] = useState<null | string>(null);
const [loading, setLoading] = useState(true);
const navigate = useNavigate();
useEffect(() => {
getClips()
.then((data) => setClips(data.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())))
.catch((err) => setError(err));
.catch((err) => setError(err))
.finally(() => setLoading(false));
}, []);
const handleDelete = async (id: number) => {
@@ -42,7 +44,7 @@ const MyClips = () => {
))}
</div>
{clips.length === 0 && !error && (
{clips.length === 0 && !error && !loading && (
<div className="flex flex-col items-center justify-center py-16 text-muted">
<p className="text-base">No clips yet.</p>
<p className="text-sm mt-1">Upload your first clip to get started.</p>

View File

@@ -7,12 +7,14 @@ import type { Vod } from "../utils/types";
const MyVods = () => {
const [vods, setVods] = useState<Vod[]>([]);
const [error, setError] = useState<null | string>(null);
const [loading, setLoading] = useState(true);
const navigate = useNavigate();
useEffect(() => {
getVods()
.then((data) => setVods(data.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())))
.catch((err) => setError(err instanceof Error ? err.message : "Failed to load vods"));
.catch((err) => setError(err instanceof Error ? err.message : "Failed to load vods"))
.finally(() => setLoading(false));
}, []);
const handleDelete = async (id: number) => {
@@ -45,7 +47,7 @@ const MyVods = () => {
))}
</div>
{vods.length === 0 && !error && (
{vods.length === 0 && !error && !loading && (
<div className="flex flex-col items-center justify-center py-16 text-muted">
<p className="text-base">No VoDs yet.</p>
<p className="text-sm mt-1">Your stream recordings will appear here.</p>