fix: upgrade sussces auto hide

This commit is contained in:
Joel 2024-11-21 17:38:09 +08:00
parent 02c5989612
commit 8993a91f12
3 changed files with 4 additions and 24 deletions

View File

@ -1,20 +0,0 @@
'use client'
import { useBoolean } from 'ahooks'
import UpdatePlugin from '@/app/components/plugins/update-plugin'
const Page = () => {
const [isShowUpdateModal, {
setTrue: showUpdateModal,
setFalse: hideUpdateModal,
}] = useBoolean(false)
return (
<div>
<div onClick={showUpdateModal}>Show Upgrade</div>
{isShowUpdateModal && (
<UpdatePlugin onHide={hideUpdateModal} />
)}
</div>
)
}
export default Page

View File

@ -77,6 +77,7 @@ const PluginPage = ({
if (packageId) {
const { data } = await fetchManifestFromMarketPlace(encodeURIComponent(packageId))
const { plugin } = data
// TODO: wait api return current plugin version
setManifest({
...plugin,
icon: `${marketplaceApiPrefix}/plugins/${plugin.org}/${plugin.name}/icon`,
@ -84,6 +85,7 @@ const PluginPage = ({
showInstallFromMarketplace()
}
})()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [packageId])
const {

View File

@ -94,11 +94,9 @@ const UpdatePluginModal: FC<Props> = ({
}
return
}
if (uploadStep === UploadStep.installed) {
if (uploadStep === UploadStep.installed)
onSave()
onCancel()
}
}, [onCancel, onSave, uploadStep, check, originalPackageInfo.id, handleRefetch, targetPackageInfo.id])
}, [onSave, uploadStep, check, originalPackageInfo.id, handleRefetch, targetPackageInfo.id])
const usedInAppInfo = useMemo(() => {
return (
<div className='flex px-0.5 justify-center items-center gap-0.5'>