You've already forked bilibili-subtitle
@@ -100,20 +100,20 @@ const useSubtitleService = () => {
|
||||
|
||||
// 有数据时自动展开
|
||||
useEffect(() => {
|
||||
if (infos != null) {
|
||||
if ((data != null) && data.body.length > 0) {
|
||||
eventBus.emit({
|
||||
type: EVENT_EXPAND
|
||||
})
|
||||
}
|
||||
}, [eventBus, infos])
|
||||
}, [data, eventBus, infos])
|
||||
|
||||
// 当前未展示 & 未折叠 & 有列表 => 展示第一个
|
||||
// 当前未展示 & (未折叠 | 自动展开) & 有列表 => 展示第一个
|
||||
useEffect(() => {
|
||||
if (!curInfo && !fold && (infos != null) && infos.length > 0) {
|
||||
if (!curInfo && (!fold || (envReady && envData.autoExpand)) && (infos != null) && infos.length > 0) {
|
||||
dispatch(setCurInfo(infos[0]))
|
||||
dispatch(setCurFetched(false))
|
||||
}
|
||||
}, [curInfo, dispatch, envReady, fold, infos])
|
||||
}, [curInfo, dispatch, envData.autoExpand, envReady, fold, infos])
|
||||
// 获取
|
||||
useEffect(() => {
|
||||
if (curInfo && !curFetched) {
|
||||
|
Reference in New Issue
Block a user