fix: nextjs server component map crash when backend returns null slices; Bump v4.0.6

This commit is contained in:
KV-Tube Deployer 2026-02-23 07:25:28 +07:00
parent a8a562544e
commit e05c4b9654
4 changed files with 10 additions and 6 deletions

View file

@ -38,7 +38,7 @@ version: '3.8'
services:
kv-tube-app:
image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.5
image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.6
container_name: kv-tube-app
restart: unless-stopped
ports:

View file

@ -5,7 +5,7 @@ version: '3.8'
services:
kv-tube-app:
image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.5
image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.6
container_name: kv-tube-app
platform: linux/amd64
restart: unless-stopped

View file

@ -23,7 +23,8 @@ async function getHistory() {
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/history?limit=20`, { cache: 'no-store' });
if (!res.ok) return [];
return res.json() as Promise<VideoData[]>;
const data = await res.json();
return Array.isArray(data) ? data : [];
} catch {
return [];
}
@ -33,7 +34,8 @@ async function getSubscriptions() {
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/subscriptions`, { cache: 'no-store' });
if (!res.ok) return [];
return res.json() as Promise<Subscription[]>;
const data = await res.json();
return Array.isArray(data) ? data : [];
} catch {
return [];
}

View file

@ -24,7 +24,8 @@ async function getSubscriptions() {
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/subscriptions`, { cache: 'no-store' });
if (!res.ok) return [];
return res.json() as Promise<Subscription[]>;
const data = await res.json();
return Array.isArray(data) ? data : [];
} catch {
return [];
}
@ -34,7 +35,8 @@ async function getChannelVideos(channelId: string, limit: number = 5) {
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/channel/videos?id=${channelId}&limit=${limit}`, { cache: 'no-store' });
if (!res.ok) return [];
return res.json() as Promise<VideoData[]>;
const data = await res.json();
return Array.isArray(data) ? data : [];
} catch {
return [];
}