File tree 1 file changed +19
-17
lines changed 1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -5,26 +5,28 @@ import { withInstabugIOS } from './withInstabugIOS';
5
5
6
6
export interface PluginProps {
7
7
name ?: string ;
8
+ enable ?: boolean ;
8
9
}
9
10
10
- const withInstabugPlugin : ConfigPlugin < PluginProps | void > = ( config , props ) => {
11
+ const withInstabugPlugin : ConfigPlugin < PluginProps > = ( config , props ) => {
11
12
let cfg = config ;
12
- try {
13
- cfg = withInstabugAndroid ( cfg , {
14
- ...props ,
15
- name : instabugPackage . name ,
16
- } ) ;
17
- } catch ( e ) {
18
- console . warn ( `There was a problem with configuring your native Android project: ${ e } ` ) ;
19
- }
20
-
21
- try {
22
- cfg = withInstabugIOS ( cfg , {
23
- ...props ,
24
- name : instabugPackage . name ,
25
- } ) ;
26
- } catch ( e ) {
27
- console . warn ( `There was a problem with configuring your native iOS project: ${ e } ` ) ;
13
+ if ( props . enable === true ) {
14
+ try {
15
+ cfg = withInstabugAndroid ( cfg , {
16
+ ...props ,
17
+ name : instabugPackage . name ,
18
+ } ) ;
19
+ } catch ( e ) {
20
+ console . warn ( `There was a problem with configuring your native Android project: ${ e } ` ) ;
21
+ }
22
+ try {
23
+ cfg = withInstabugIOS ( cfg , {
24
+ ...props ,
25
+ name : instabugPackage . name ,
26
+ } ) ;
27
+ } catch ( e ) {
28
+ console . warn ( `There was a problem with configuring your native iOS project: ${ e } ` ) ;
29
+ }
28
30
}
29
31
30
32
return cfg ;
You can’t perform that action at this time.
0 commit comments