fix: switch plugin version

This commit is contained in:
AkaraChen 2025-01-08 10:03:00 +08:00
parent 6006380723
commit 99e2eaa6ee

View File

@ -34,6 +34,11 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
pluginDetails.refetch() pluginDetails.refetch()
onChange?.(targetVersion!) onChange?.(targetVersion!)
}, [hideUpdateModal, onChange, pluginDetails, targetVersion]) }, [hideUpdateModal, onChange, pluginDetails, targetVersion])
const targetUniqueIdentifier = (() => {
if (!targetVersion || !pluginDetail) return uniqueIdentifier
return uniqueIdentifier.replaceAll(pluginDetail.version, targetVersion)
})()
return <Tooltip popupContent={!isShow && !isShowUpdateModal && tooltip} triggerMethod='hover'> return <Tooltip popupContent={!isShow && !isShowUpdateModal && tooltip} triggerMethod='hover'>
<div className='w-fit'> <div className='w-fit'>
{isShowUpdateModal && pluginDetail && <UpdateFromMarketplace {isShowUpdateModal && pluginDetail && <UpdateFromMarketplace
@ -43,7 +48,7 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
payload: pluginDetail.declaration, payload: pluginDetail.declaration,
}, },
targetPackageInfo: { targetPackageInfo: {
id: uniqueIdentifier, id: targetUniqueIdentifier,
version: targetVersion!, version: targetVersion!,
}, },
}} }}