From 9fb95636b5e4103eb9ad7341a8e272799ee77289 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 18 Jun 2024 15:35:09 -0600 Subject: [PATCH] skip empty update --- lib/Onyx.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Onyx.ts b/lib/Onyx.ts index 662494ed..a20cd32f 100644 --- a/lib/Onyx.ts +++ b/lib/Onyx.ts @@ -666,6 +666,11 @@ function updateSnapshots(data: OnyxUpdate[]) { updatedData = {...updatedData, [key]: lodashPick(value, Object.keys(snapshotData[key]))}; }); + // Skip the update if there's no data to be merged + if (utils.isEmptyObject(updatedData)) { + return; + } + promises.push(() => merge(snapshotKey, {data: updatedData})); });