Skip to content

Commit

Permalink
Keep original logic and move didLoad persisted call
Browse files Browse the repository at this point in the history
  • Loading branch information
Amal Nazeem committed Jun 10, 2021
1 parent afb44ff commit 56f152a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ let didLoadPersistedRequests;
Onyx.connect({
key: ONYXKEYS.NETWORK_REQUEST_QUEUE,
callback: (persistedRequests) => {
if (didLoadPersistedRequests || !persistedRequests || persistedRequests.length === 0) {
if (didLoadPersistedRequests || !persistedRequests) {
return;
}

// Merge the persisted requests with the requests in memory then clear out the queue as we only need to load
// this once when the app initializes
networkRequestQueue = [...networkRequestQueue, ...persistedRequests];
Onyx.set(ONYXKEYS.NETWORK_REQUEST_QUEUE, []);
didLoadPersistedRequests = true;
Onyx.set(ONYXKEYS.NETWORK_REQUEST_QUEUE, []);
},
});

Expand Down

0 comments on commit 56f152a

Please sign in to comment.