File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -921,6 +921,11 @@ async function handleInstallPluginRequest(request: BackgroundAction) {
921
921
try {
922
922
const hex = Buffer . from ( arrayBuffer ) . toString ( 'hex' ) ;
923
923
const hash = await addPlugin ( hex ) ;
924
+
925
+ if ( ! hash ) {
926
+ throw new Error ( 'Plugin already exist.' ) ;
927
+ }
928
+
924
929
await addPluginConfig ( hash ! , config ) ;
925
930
await addPluginMetadata ( hash ! , {
926
931
...metadata ,
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ import {
20
20
usePluginConfig ,
21
21
usePluginHashes ,
22
22
} from '../../reducers/plugins' ;
23
- import { PluginConfig } from '../../utils/misc' ;
24
- import { getPluginConfigByHash } from '../../entries/Background/db' ;
25
23
import { fetchPluginHashes } from '../../utils/rpc' ;
26
24
import DefaultPluginIcon from '../../assets/img/default-plugin-icon.png' ;
27
25
@@ -212,6 +210,8 @@ function PluginIcon({ hash }: { hash: string }) {
212
210
onPluginClick ( ) ;
213
211
} , [ onPluginClick , config ] ) ;
214
212
213
+ if ( ! config ) return null ;
214
+
215
215
return (
216
216
< button
217
217
className = { classNames (
You can’t perform that action at this time.
0 commit comments