Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed May 15, 2024
1 parent 15600b0 commit ccedd1c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ function enqueue(updates: OnyxUpdatesFromServer | DeferredUpdatesDictionary, opt
SequentialQueue.pause();
}

// We check here if the "updates" param is a single update.
// If so, we only need to insert one update into the deferred updates queue.
if (isValidOnyxUpdateFromServer(updates)) {
const lastUpdateID = Number(updates.lastUpdateID);
deferredUpdates[lastUpdateID] = updates;
} else {
// If the "updates" param is an object, we need to insert multiple updates into the deferred updates queue.
Object.entries(updates).forEach(([lastUpdateIDString, update]) => {
const lastUpdateID = Number(lastUpdateIDString);
if (deferredUpdates[lastUpdateID]) {
Expand Down

0 comments on commit ccedd1c

Please sign in to comment.