Merge pull request woocommerce/woocommerce-admin#1732 from woocommerce/fix/1565-disable-data-fetch-inactive-tabs
Skip dispatching fresh data requests when the window/tab is hidden.
This commit is contained in:
commit
d7218a759b
|
@ -19,6 +19,9 @@ function createStore( name ) {
|
|||
function createDataHandlers( store ) {
|
||||
return {
|
||||
dataRequested: resourceNames => {
|
||||
if ( document.hidden ) {
|
||||
return;
|
||||
}
|
||||
store.dispatch( {
|
||||
type: 'FRESH_DATA_REQUESTED',
|
||||
resourceNames,
|
||||
|
|
Loading…
Reference in New Issue