diff --git a/web/app/components/plugins/install-plugin/install-from-local-package/steps/uploading.tsx b/web/app/components/plugins/install-plugin/install-from-local-package/steps/uploading.tsx index d266ef6d7c..d4e5b84ff2 100644 --- a/web/app/components/plugins/install-plugin/install-from-local-package/steps/uploading.tsx +++ b/web/app/components/plugins/install-plugin/install-from-local-package/steps/uploading.tsx @@ -1,7 +1,6 @@ 'use client' import type { FC } from 'react' import type { Dependency, PluginDeclaration } from '../../../types' -import { RiLoader2Line } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' @@ -34,34 +33,34 @@ const Uploading: FC = ({ const fileName = file.name const handleUpload = async () => { try { - await uploadFile(file, isBundle) + // eslint-disable-next-line ts/no-explicit-any + const res: any = await uploadFile(file, isBundle) + if (isBundle) { + onBundleUploaded(res) + return + } + onPackageUploaded({ + uniqueIdentifier: res.unique_identifier, + manifest: res.manifest, + }) } + // eslint-disable-next-line ts/no-explicit-any catch (e: any) { if (e.response?.message) { onFailed(e.response?.message) } - else { // Why it would into this branch? - const res = e.response - if (isBundle) { - onBundleUploaded(res) - return - } - onPackageUploaded({ - uniqueIdentifier: res.unique_identifier, - manifest: res.manifest, - }) - } } } React.useEffect(() => { handleUpload() + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) return ( <>
- +
{t(`${i18nPrefix}.uploadingPackage`, { ns: 'plugin', @@ -72,6 +71,7 @@ const Uploading: FC = ({