fix: installed plugin not show upgrade (#13523)

This commit is contained in:
Joel 2025-02-11 14:08:43 +08:00 committed by GitHub
parent 50cfb7c9ec
commit 31c17e6378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,10 +87,13 @@ const InstallByDSLList: FC<Props> = ({
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<Props> = ({
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}`)}
/>
)