fix: handle install the same version

This commit is contained in:
Joel 2024-11-28 13:50:04 +08:00
parent f40b212b04
commit fba468e8ad

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React, { useMemo } from 'react'
import React, { useEffect, useMemo } from 'react'
// import { RiInformation2Line } from '@remixicon/react'
import type { Plugin, PluginManifestInMarket } from '../../../types'
import Card from '../../../card'
@ -51,6 +51,11 @@ const Installed: FC<Props> = ({
stop,
} = checkTaskStatus()
useEffect(() => {
if (hasInstalled && toInstallVersion === installedVersion)
onInstalled()
}, [hasInstalled, toInstallVersion, installedVersion])
const handleCancel = () => {
stop()
onCancel()
@ -107,7 +112,7 @@ const Installed: FC<Props> = ({
return (<>{
!installedVersion
? (
<Badge className='mx-1' size="s" state={BadgeState.Default}>{ }</Badge>
<Badge className='mx-1' size="s" state={BadgeState.Default}>{toInstallVersion}</Badge>
)
: (
<>