fix: installed plugin not show upgrade (#13523)

pull/13537/head
Joel 1 year ago committed by GitHub
parent 50cfb7c9ec
commit 31c17e6378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -87,10 +87,13 @@ const InstallByDSLList: FC<Props> = ({
const failedIndex: number[] = [] const failedIndex: number[] = []
const nextPlugins = produce(pluginsRef.current, (draft) => { const nextPlugins = produce(pluginsRef.current, (draft) => {
marketPlaceInDSLIndex.forEach((index, i) => { marketPlaceInDSLIndex.forEach((index, i) => {
if (payloads[i]) if (payloads[i]) {
draft[index] = payloads[i] draft[index] = {
else ...payloads[i],
failedIndex.push(index) version: payloads[i].version || payloads[i].latest_version,
}
}
else { failedIndex.push(index) }
}) })
}) })
setPlugins(nextPlugins) setPlugins(nextPlugins)
@ -192,8 +195,8 @@ const InstallByDSLList: FC<Props> = ({
key={index} key={index}
checked={!!selectedPlugins.find(p => p.plugin_id === plugins[index]?.plugin_id)} checked={!!selectedPlugins.find(p => p.plugin_id === plugins[index]?.plugin_id)}
onCheckedChange={handleSelect(index)} onCheckedChange={handleSelect(index)}
payload={plugins[index] as Plugin} payload={plugin}
version={(d as GitHubItemAndMarketPlaceDependency).value.version!} version={(d as GitHubItemAndMarketPlaceDependency).value.version! || plugin?.version || ''}
versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)} versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)}
/> />
) )

Loading…
Cancel
Save