From 392db19ea20e1056e207b21fb3c41e25061af7a0 Mon Sep 17 00:00:00 2001 From: Yi Date: Fri, 8 Nov 2024 11:08:40 +0800 Subject: [PATCH] chore: update the update plugin steps --- .../plugins/install-plugin/install-from-github/index.tsx | 9 ++------- web/app/components/plugins/plugin-item/action.tsx | 1 + web/app/components/plugins/types.ts | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-from-github/index.tsx b/web/app/components/plugins/install-plugin/install-from-github/index.tsx index cc1fd3a403..c74071e808 100644 --- a/web/app/components/plugins/install-plugin/install-from-github/index.tsx +++ b/web/app/components/plugins/install-plugin/install-from-github/index.tsx @@ -1,6 +1,6 @@ 'use client' -import React, { useCallback, useEffect, useState } from 'react' +import React, { useCallback, useState } from 'react' import Modal from '@/app/components/base/modal' import type { Item } from '@/app/components/base/select' import type { InstallState } from '@/app/components/plugins/types' @@ -35,7 +35,7 @@ const InstallFromGitHub: React.FC = ({ updatePayload, on : '', selectedVersion: '', selectedPackage: '', - releases: [], + releases: updatePayload ? updatePayload.originalPackageInfo.releases : [], }) const [uniqueIdentifier, setUniqueIdentifier] = useState(null) const [manifest, setManifest] = useState(null) @@ -133,11 +133,6 @@ const InstallFromGitHub: React.FC = ({ updatePayload, on }) } - useEffect(() => { - if (state.step === InstallStepFromGitHub.selectPackage) - handleUrlSubmit() - }, []) - return ( = ({ repo: `https://github.com/${meta!.repo}`, version: meta!.version, package: meta!.package, + releases: fetchedReleases, }, }, }, diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index f0f80a3e57..304ebcab69 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -155,6 +155,7 @@ export type UpdateFromGitHubPayload = { repo: string version: string package: string + releases: GitHubRepoReleaseResponse[] } }