Skip to content

Commit 931ccb7

Browse files
committed
Changed the monitored action type, removed the timeout
1 parent 86bd73d commit 931ccb7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

client/apps/shipping-label/redux-middleware.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
*/
44
//from calypso
55
import {
6-
WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW,
6+
WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE,
77
} from 'woocommerce/woocommerce-services/state/action-types';
88

99
const middlewareActions = {
10-
[ WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW ]: () => {
10+
[ WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE ]: ( { error } ) => {
11+
if ( error ) {
12+
return;
13+
}
1114
window.wc_shipment_tracking_refresh && window.wc_shipment_tracking_refresh();
1215
},
1316
};
@@ -22,5 +25,5 @@ export default () => ( next ) => ( action ) => {
2225
}
2326

2427
// perform the action
25-
setTimeout( () => middlewareAction( action ) );
28+
middlewareAction( action );
2629
};

0 commit comments

Comments
 (0)