fix: speed test ui

This commit is contained in:
shinya
2025-07-11 10:25:41 +08:00
parent 244ad17a5b
commit 868ec2d5aa
2 changed files with 22 additions and 16 deletions

View File

@@ -525,6 +525,11 @@ function PlayPageClient() {
// 清理URL参数移除index参数
if (searchParams.has('index')) {
const newUrl = new URL(window.location.href);
newUrl.searchParams.set('year', detailData.year || 'unknown');
newUrl.searchParams.set(
'title',
detailData.title || videoTitleRef.current
);
newUrl.searchParams.delete('index');
newUrl.searchParams.delete('position');
window.history.replaceState({}, '', newUrl.toString());

View File

@@ -522,25 +522,26 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
{(() => {
const sourceKey = `${source.source}-${source.id}`;
const videoInfo = videoInfoMap.get(sourceKey);
if (videoInfo && !videoInfo.hasError) {
return (
<div className='flex items-end gap-3 text-xs'>
<div className='text-green-600 dark:text-green-400 font-medium text-xs'>
{videoInfo.loadSpeed}
if (videoInfo) {
if (!videoInfo.hasError) {
return (
<div className='flex items-end gap-3 text-xs'>
<div className='text-green-600 dark:text-green-400 font-medium text-xs'>
{videoInfo.loadSpeed}
</div>
<div className='text-orange-600 dark:text-orange-400 font-medium text-xs'>
{videoInfo.pingTime}ms
</div>
</div>
<div className='text-orange-600 dark:text-orange-400 font-medium text-xs'>
{videoInfo.pingTime}ms
);
} else {
return (
<div className='text-red-500/90 dark:text-red-400 font-medium text-xs'>
</div>
</div>
);
); // 占位div
}
}
return (
<div className='text-red-500/90 dark:text-red-400 font-medium text-xs'>
</div>
); // 占位div
})()}
</div>
</div>