mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 16:49:07 +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)
|
||||
}
|
||||
}
|
||||
}, []) // 只在组件挂载时执行一次
|
||||
}, [htmlContent]) // 只在组件挂载时执行一次
|
||||
|
||||
if (!visible) return null
|
||||
const isHtmlEmpty = !debouncedHtml.trim()
|
||||
|
||||
@ -128,7 +128,7 @@ export const QuickPanelView: React.FC<Props> = ({ setInputText }) => {
|
||||
prevSymbolRef.current = ctx.symbol
|
||||
|
||||
return newList
|
||||
}, [ctx.defaultIndex, ctx.isVisible, ctx.list, ctx.symbol, searchText])
|
||||
}, [ctx.isVisible, ctx.list, ctx.symbol, searchText])
|
||||
|
||||
const canForwardAndBackward = useMemo(() => {
|
||||
return list.some((item) => item.isMenu) || historyPanel.length > 0
|
||||
|
||||
@ -43,7 +43,7 @@ const QuotaTag: FC<{ base: KnowledgeBase; providerId: string; quota?: number }>
|
||||
return
|
||||
}
|
||||
checkQuota()
|
||||
}, [_quota, base, provider.id, provider.apiKey])
|
||||
}, [_quota, base, provider.id, provider.apiKey, quota, updateProvider])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user