Skip to content

Commit

Permalink
update save function
Browse files Browse the repository at this point in the history
  • Loading branch information
namhihi237 committed Oct 4, 2023
1 parent 658bffa commit b7d8299
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/actions/PersistedRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ function clear() {
}

function save(requestsToPersist: Request[]) {
let requests: Request[] = [];
if (persistedRequests.length) {
persistedRequests = persistedRequests.concat(requestsToPersist);
requests = persistedRequests.concat(requestsToPersist);
} else {
persistedRequests = requestsToPersist;
requests = requestsToPersist;
}
Onyx.set(ONYXKEYS.PERSISTED_REQUESTS, persistedRequests);
persistedRequests = requests;
Onyx.set(ONYXKEYS.PERSISTED_REQUESTS, requests);
}

function remove(requestToRemove: Request) {
Expand Down

0 comments on commit b7d8299

Please sign in to comment.