mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 06:19:05 +08:00
fix: update dependencies in effect hooks for improved reactivity
This commit is contained in:
parent
88f0596a1f
commit
bb6734c628
@ -157,7 +157,7 @@ const PreviewSectionComponent: React.FC<PreviewSectionProps> = ({ html, visible
|
|||||||
clearInterval(intervalRef.current)
|
clearInterval(intervalRef.current)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []) // 只在组件挂载时执行一次
|
}, [htmlContent]) // 只在组件挂载时执行一次
|
||||||
|
|
||||||
if (!visible) return null
|
if (!visible) return null
|
||||||
const isHtmlEmpty = !debouncedHtml.trim()
|
const isHtmlEmpty = !debouncedHtml.trim()
|
||||||
|
|||||||
@ -128,7 +128,7 @@ export const QuickPanelView: React.FC<Props> = ({ setInputText }) => {
|
|||||||
prevSymbolRef.current = ctx.symbol
|
prevSymbolRef.current = ctx.symbol
|
||||||
|
|
||||||
return newList
|
return newList
|
||||||
}, [ctx.defaultIndex, ctx.isVisible, ctx.list, ctx.symbol, searchText])
|
}, [ctx.isVisible, ctx.list, ctx.symbol, searchText])
|
||||||
|
|
||||||
const canForwardAndBackward = useMemo(() => {
|
const canForwardAndBackward = useMemo(() => {
|
||||||
return list.some((item) => item.isMenu) || historyPanel.length > 0
|
return list.some((item) => item.isMenu) || historyPanel.length > 0
|
||||||
|
|||||||
@ -43,7 +43,7 @@ const QuotaTag: FC<{ base: KnowledgeBase; providerId: string; quota?: number }>
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
checkQuota()
|
checkQuota()
|
||||||
}, [_quota, base, provider.id, provider.apiKey])
|
}, [_quota, base, provider.id, provider.apiKey, quota, updateProvider])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user