优化弹幕加载提示
This commit is contained in:
@@ -1809,6 +1809,9 @@ function PlayPageClient() {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取弹幕剧集列表失败:', error);
|
||||
if (artPlayerRef.current) {
|
||||
artPlayerRef.current.notice.show = '弹幕加载失败:无法获取剧集列表';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1825,6 +1828,9 @@ function PlayPageClient() {
|
||||
setDanmakuMatches(searchResult.animes);
|
||||
setShowDanmakuSourceSelector(true);
|
||||
setDanmakuLoading(false);
|
||||
if (artPlayerRef.current) {
|
||||
artPlayerRef.current.notice.show = `找到 ${searchResult.animes.length} 个弹幕源,请选择`;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1874,12 +1880,21 @@ function PlayPageClient() {
|
||||
}
|
||||
} else {
|
||||
console.warn('未找到剧集信息');
|
||||
if (artPlayerRef.current) {
|
||||
artPlayerRef.current.notice.show = '弹幕加载失败:未找到剧集信息';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.warn('未找到匹配的弹幕');
|
||||
if (artPlayerRef.current) {
|
||||
artPlayerRef.current.notice.show = '未找到匹配的弹幕,可在弹幕选项卡手动搜索';
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('自动搜索弹幕失败:', error);
|
||||
if (artPlayerRef.current) {
|
||||
artPlayerRef.current.notice.show = '弹幕加载失败,请检查网络或稍后重试';
|
||||
}
|
||||
} finally {
|
||||
setDanmakuLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user