fix(web): use atomic selectors to fix Zustand v5 infinite loop (#28977)

This commit is contained in:
yyh 2025-12-01 15:45:50 +08:00 committed by GitHub
parent f4db5f9973
commit 626d4f3e35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 8 deletions

View File

@ -47,10 +47,8 @@ const ChatWrapper = (
const startVariables = startNode?.data.variables
const appDetail = useAppStore(s => s.appDetail)
const workflowStore = useWorkflowStore()
const { inputs, setInputs } = useStore(s => ({
inputs: s.inputs,
setInputs: s.setInputs,
}))
const inputs = useStore(s => s.inputs)
const setInputs = useStore(s => s.setInputs)
const initialInputs = useMemo(() => {
const initInputs: Record<string, any> = {}

View File

@ -32,10 +32,7 @@ type Props = {
const InputsPanel = ({ onRun }: Props) => {
const { t } = useTranslation()
const workflowStore = useWorkflowStore()
const { inputs } = useStore(s => ({
inputs: s.inputs,
setInputs: s.setInputs,
}))
const inputs = useStore(s => s.inputs)
const fileSettings = useHooksStore(s => s.configsMap?.fileSettings)
const nodes = useNodes<StartNodeType>()
const files = useStore(s => s.files)