File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,21 @@ function* saveAppPreference() {
19
19
}
20
20
21
21
function * fetchPurchases ( ) {
22
- const purchases = yield InAppPurchase . getPurchases ( ) ;
23
- yield put ( { type : actionTypes . RECEIVE_PURCHASES , purchases} ) ;
22
+ try {
23
+ const purchases = yield InAppPurchase . getPurchases ( ) ;
24
+ yield put ( { type : actionTypes . RECEIVE_PURCHASES , purchases} ) ;
25
+ } catch ( e ) {
26
+ console . warn ( 'Could not fetch purchases' , e ) ;
27
+ }
24
28
}
25
29
26
30
function * makeDonation ( ) {
27
- const orderId = yield InAppPurchase . buy ( 'donation' ) ;
28
- console . info ( `InAppPurchase.buy => orderId: ${ orderId } ` ) ;
31
+ try {
32
+ const orderId = yield InAppPurchase . buy ( 'donation' ) ;
33
+ console . info ( `InAppPurchase.buy => orderId: ${ orderId } ` ) ;
34
+ } catch ( e ) {
35
+ console . warn ( 'Could not make a request for purchase' , e ) ;
36
+ }
29
37
yield fetchPurchases ( ) ;
30
38
}
31
39
You can’t perform that action at this time.
0 commit comments