Stop API requests when we know no alerts exist
This commit is contained in:
parent
dd8d1fbb8b
commit
0cdaf1bee2
|
@ -137,6 +137,12 @@ class StoreAlerts extends Component {
|
|||
|
||||
export default compose(
|
||||
withSelect( select => {
|
||||
const { alertCount } = wcSettings;
|
||||
|
||||
if ( ! alertCount || 0 === alertCount ) {
|
||||
return { alerts: null };
|
||||
}
|
||||
|
||||
const { getNotes } = select( 'wc-api' );
|
||||
const alertsQuery = {
|
||||
page: 1,
|
||||
|
|
Loading…
Reference in New Issue