From 31c17e637876fcb667f2b678f5b02d52486d9a7d Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 11 Feb 2025 14:08:43 +0800 Subject: [PATCH] fix: installed plugin not show upgrade (#13523) --- .../install-bundle/steps/install-multi.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx index 803be4abd4..40be3e65e6 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx @@ -87,10 +87,13 @@ const InstallByDSLList: FC = ({ const failedIndex: number[] = [] const nextPlugins = produce(pluginsRef.current, (draft) => { marketPlaceInDSLIndex.forEach((index, i) => { - if (payloads[i]) - draft[index] = payloads[i] - else - failedIndex.push(index) + if (payloads[i]) { + draft[index] = { + ...payloads[i], + version: payloads[i].version || payloads[i].latest_version, + } + } + else { failedIndex.push(index) } }) }) setPlugins(nextPlugins) @@ -192,8 +195,8 @@ const InstallByDSLList: FC = ({ key={index} checked={!!selectedPlugins.find(p => p.plugin_id === plugins[index]?.plugin_id)} onCheckedChange={handleSelect(index)} - payload={plugins[index] as Plugin} - version={(d as GitHubItemAndMarketPlaceDependency).value.version!} + payload={plugin} + version={(d as GitHubItemAndMarketPlaceDependency).value.version! || plugin?.version || ''} versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)} /> )