Revert "去除是否自动展开配置"

This reverts commit e6db6747
This commit is contained in:
IndieKKY
2024-03-19 21:39:16 +08:00
parent 2383603b39
commit 9b2d620cdf
5 changed files with 20 additions and 18 deletions

View File

@@ -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) {