Skip to content

Commit

Permalink
Copy persistedRequests before saving it
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Apr 12, 2024
1 parent cd00c71 commit 5da5211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/PersistedRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function clear() {
}

function save(requestToPersist: Request) {
persistedRequests.push(requestToPersist);
Onyx.set(ONYXKEYS.PERSISTED_REQUESTS, persistedRequests);
const requests = [...persistedRequests, requestToPersist];
Onyx.set(ONYXKEYS.PERSISTED_REQUESTS, requests);
}

function remove(requestToRemove: Request) {
Expand Down

0 comments on commit 5da5211

Please sign in to comment.