From 5da5211f190056a07f00dc7a23c2d9bef775030a Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 12 Apr 2024 12:13:20 -0700 Subject: [PATCH] Copy persistedRequests before saving it --- src/libs/actions/PersistedRequests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/PersistedRequests.ts b/src/libs/actions/PersistedRequests.ts index 8894af8c374f..e37a50c72617 100644 --- a/src/libs/actions/PersistedRequests.ts +++ b/src/libs/actions/PersistedRequests.ts @@ -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) {