From 97875d2b550bb6fe192418a7247d9f83e645000f Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Wed, 3 Sep 2025 14:27:29 +0800 Subject: [PATCH] plugin dependencies select all --- .../install-bundle/steps/install.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx index fabad62397..758daafca0 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx @@ -39,11 +39,18 @@ const Install: FC = ({ const selectedPluginsNum = selectedPlugins.length const installMultiRef = useRef(null) const { refreshPluginList } = useRefreshPluginList() - + const [isSelectAll, setIsSelectAll] = useState(false) + const handleClickSelectAll = useCallback(() => { + if (isSelectAll) + installMultiRef.current?.deSelectAllPlugins() + else + installMultiRef.current?.selectAllPlugins() + }, [isSelectAll]) const [canInstall, setCanInstall] = React.useState(false) const [installedInfo, setInstalledInfo] = useState | undefined>(undefined) const handleLoadedAllPlugin = useCallback((installedInfo: Record | undefined) => { + handleClickSelectAll() setInstalledInfo(installedInfo) setCanInstall(true) }, []) @@ -74,14 +81,7 @@ const Install: FC = ({ installedInfo: installedInfo!, }) } - const [isSelectAll, setIsSelectAll] = useState(false) const [isIndeterminate, setIsIndeterminate] = useState(false) - const handleClickSelectAll = useCallback(() => { - if (isSelectAll) - installMultiRef.current?.deSelectAllPlugins() - else - installMultiRef.current?.selectAllPlugins() - }, [isSelectAll]) const handleSelectAll = useCallback((plugins: Plugin[], selectedIndexes: number[]) => { setSelectedPlugins(plugins) setSelectedIndexes(selectedIndexes)