From 6928b5fa00cc24097b0d2e6cba3c9c4f6b0bef2d Mon Sep 17 00:00:00 2001 From: IndieKKY Date: Sun, 6 Oct 2024 19:54:40 +0800 Subject: [PATCH] fix --- src/hooks/useSubtitleService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/useSubtitleService.ts b/src/hooks/useSubtitleService.ts index 034e6ab..875655f 100644 --- a/src/hooks/useSubtitleService.ts +++ b/src/hooks/useSubtitleService.ts @@ -94,7 +94,10 @@ const useSubtitleService = () => { useAsyncEffect(async () => { // 初始获取列表 sendInject('REFRESH_VIDEO_INFO', {force: true}) - // 初始获取设置信息 + }, []) + + useAsyncEffect(async () => { + // 更新设置信息 sendInject('GET_VIDEO_ELEMENT_INFO', {}).then(info => { dispatch(setNoVideo(info.noVideo)) if (envData.sidePanel) { @@ -104,7 +107,7 @@ const useSubtitleService = () => { dispatch(setTotalHeight(Math.min(Math.max(info.totalHeight, TOTAL_HEIGHT_MIN), TOTAL_HEIGHT_MAX))) } }) - }, [envData.sidePanel]) + }, [envData.sidePanel, infos]) // 更新当前位置 useEffect(() => {