mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
refactor: remove version prop from plugin item components and update version comparison logic
This commit is contained in:
parent
61eb655823
commit
fa6858090b
|
@ -23,7 +23,6 @@ type Props = {
|
|||
installationId: string
|
||||
pluginUniqueIdentifier: string
|
||||
pluginName: string
|
||||
version: string
|
||||
usedInApps: number
|
||||
isShowFetchNewVersion: boolean
|
||||
isShowInfo: boolean
|
||||
|
@ -36,7 +35,6 @@ const Action: FC<Props> = ({
|
|||
installationId,
|
||||
pluginUniqueIdentifier,
|
||||
pluginName,
|
||||
version,
|
||||
isShowFetchNewVersion,
|
||||
isShowInfo,
|
||||
isShowDelete,
|
||||
|
@ -63,7 +61,7 @@ const Action: FC<Props> = ({
|
|||
return
|
||||
const versions = fetchedReleases.map(release => release.tag_name)
|
||||
const latestVersion = getLatestVersion(versions)
|
||||
if (compareVersion(latestVersion, version) === 1) {
|
||||
if (compareVersion(latestVersion, meta!.version) === 1) {
|
||||
setShowUpdatePluginModal({
|
||||
onSaveCallback: () => {
|
||||
invalidateInstalledPluginList()
|
||||
|
|
|
@ -48,7 +48,6 @@ const PluginItem: FC<Props> = ({
|
|||
endpoints_active,
|
||||
meta,
|
||||
plugin_id,
|
||||
version,
|
||||
} = plugin
|
||||
const { category, author, name, label, description, icon, verified } = plugin.declaration
|
||||
|
||||
|
@ -93,7 +92,6 @@ const PluginItem: FC<Props> = ({
|
|||
installationId={installation_id}
|
||||
author={author}
|
||||
pluginName={name}
|
||||
version={version}
|
||||
usedInApps={5}
|
||||
isShowFetchNewVersion={source === PluginSource.github}
|
||||
isShowInfo={source === PluginSource.github}
|
||||
|
|
Loading…
Reference in New Issue
Block a user