fix: handle install the same version

pull/12372/head
Joel 1 year ago
parent f40b212b04
commit fba468e8ad

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

Loading…
Cancel
Save