File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default function Menu(props: {
6060 props . setOpen ( false ) ;
6161 } }
6262 >
63- < PluginUploadInfo />
63+ < PluginUploadInfo onPluginInstalled = { ( ) => props . setOpen ( false ) } />
6464 < span > Install Plugin</ span >
6565 </ MenuRow >
6666 < MenuRow
Original file line number Diff line number Diff line change @@ -26,7 +26,11 @@ import { ErrorModal } from '../ErrorModal';
2626import classNames from 'classnames' ;
2727import DefaultPluginIcon from '../../assets/img/default-plugin-icon.png' ;
2828
29- export default function PluginUploadInfo ( ) : ReactElement {
29+ export default function PluginUploadInfo ( {
30+ onPluginInstalled,
31+ } : {
32+ onPluginInstalled ?: ( ) => void ;
33+ } ) : ReactElement {
3034 const [ error , showError ] = useState ( '' ) ;
3135 const [ pluginBuffer , setPluginBuffer ] = useState < ArrayBuffer | any > ( null ) ;
3236 const [ pluginContent , setPluginContent ] = useState < PluginConfig | null > ( null ) ;
@@ -36,6 +40,7 @@ export default function PluginUploadInfo(): ReactElement {
3640 try {
3741 await addPlugin ( Buffer . from ( pluginBuffer ) . toString ( 'hex' ) ) ;
3842 setPluginContent ( null ) ;
43+ onPluginInstalled ?.( ) ;
3944 } catch ( e : any ) {
4045 showError ( e ?. message || 'Invalid Plugin' ) ;
4146 }
@@ -72,6 +77,9 @@ export default function PluginUploadInfo(): ReactElement {
7277 className = "opacity-0 absolute top-0 right-0 h-full w-full cursor-pointer"
7378 type = "file"
7479 onChange = { onPluginInfo }
80+ onClick = { ( e ) => {
81+ e . stopPropagation ( ) ;
82+ } }
7583 />
7684 { error && < ErrorModal onClose = { ( ) => showError ( '' ) } message = { error } /> }
7785 { pluginContent && (
You can’t perform that action at this time.
0 commit comments