Skip to content

一分钟搭建影视站,支持Docker等部署方式

fix(ui): 「已加入下载队列」改为入队成功后提示,避免与取消提示矛盾;删除按钮 aria-label 修正

bestZweif09c4707e7af
diff --git a/src/app/watch/page.tsx b/src/app/watch/page.tsx
index 06dbb69..f2b6098 100644
--- a/src/app/watch/page.tsx
+++ b/src/app/watch/page.tsx
@@ -17,7 +17,6 @@ const PlayerShell = dynamic(() => import('@/components/player-shell').then((m) =
});
import { EmptyState, LoadingState, Spinner } from '@/components/states';
import { SwitchSourceModal } from '@/components/switch-source';
-import { useToast } from '@/components/toast';
import { enqueueDownload } from '@/components/download-manager';
import { Icon } from '@/components/icon';
import { useAuth } from '@/components/auth';
@@ -75,7 +74,6 @@ function WatchContent() {
const episodes = useMemo(() => detailQuery.data?.episodes ?? [], [detailQuery.data]);
const videoTitle = titleParam || detailQuery.data?.videoInfo?.title || '未知视频';
- const { toast } = useToast();
// 当前播放地址:优先取剧集列表中的当前集,其次直连 URL 参数
const currentUrl = useMemo(() => {
@@ -218,7 +216,8 @@ function WatchContent() {
title: `${videoTitle}${episodes.length > 0 ? ` 第${currentIndex + 1}集` : ''}`,
format: 'MP4',
});
- toast('已加入下载队列', 'success');
+ // 「已加入下载队列」由 DownloadManager 在真正入队后提示:
+ // 这里先提示的话,用户随后取消保存位置会出现「已加入→已取消」的矛盾
}}
>
下载本集
diff --git a/src/components/download-manager.tsx b/src/components/download-manager.tsx
index af3e484..9b20819 100644
--- a/src/components/download-manager.tsx
+++ b/src/components/download-manager.tsx
@@ -171,6 +171,7 @@ export function DownloadManager({ isOpen, onClose }: { isOpen: boolean; onClose:
await db.downloads.put(entry);
refresh();
scheduleNext();
+ toast(`《${detail.title}》已加入下载队列`, 'success');
})();
};
@@ -280,7 +281,7 @@ export function DownloadManager({ isOpen, onClose }: { isOpen: boolean; onClose:
)}
<button
type="button"
- aria-label="取消并删除任务"
+ aria-label="删除下载任务"
className="p-1.5 rounded bg-chip hover:bg-hover text-content transition-colors"
onClick={() => void onCancel(t)}
>