From fba468e8ad562ffec78ea19b8de793e9bc351b4e Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 13:50:04 +0800 Subject: [PATCH] fix: handle install the same version --- .../install-from-marketplace/steps/install.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx index 1cb0594e32..d8de71c4de 100644 --- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx @@ -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 = ({ stop, } = checkTaskStatus() + useEffect(() => { + if (hasInstalled && toInstallVersion === installedVersion) + onInstalled() + }, [hasInstalled, toInstallVersion, installedVersion]) + const handleCancel = () => { stop() onCancel() @@ -107,7 +112,7 @@ const Installed: FC = ({ return (<>{ !installedVersion ? ( - { } + {toInstallVersion} ) : ( <>