From 8733b26e12a52f47c4ab11df013742e3b948d924 Mon Sep 17 00:00:00 2001
From: Tanner <88640606+Codetrauma@users.noreply.github.com>
Date: Thu, 30 Jan 2025 07:04:41 -0800
Subject: [PATCH] feat: fix Install Plugin button in extension menu
#131
---
src/components/Menu/index.tsx | 2 +-
src/components/PluginInfo/index.tsx | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index 2fb23f70..5fa2a517 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -60,7 +60,7 @@ export default function Menu(props: {
props.setOpen(false);
}}
>
-
+ props.setOpen(false)} />
Install Plugin
void;
+}): ReactElement {
const [error, showError] = useState('');
const [pluginBuffer, setPluginBuffer] = useState(null);
const [pluginContent, setPluginContent] = useState(null);
@@ -36,6 +40,7 @@ export default function PluginUploadInfo(): ReactElement {
try {
await addPlugin(Buffer.from(pluginBuffer).toString('hex'));
setPluginContent(null);
+ onPluginInstalled?.();
} catch (e: any) {
showError(e?.message || 'Invalid Plugin');
}
@@ -72,6 +77,9 @@ export default function PluginUploadInfo(): ReactElement {
className="opacity-0 absolute top-0 right-0 h-full w-full cursor-pointer"
type="file"
onChange={onPluginInfo}
+ onClick={(e) => {
+ e.stopPropagation();
+ }}
/>
{error && showError('')} message={error} />}
{pluginContent && (