diff --git a/src/libs/API/index.ts b/src/libs/API/index.ts index be1706886b1f..61c97fe17b04 100644 --- a/src/libs/API/index.ts +++ b/src/libs/API/index.ts @@ -181,8 +181,9 @@ function waitForWrites(command: TCommand) { function read(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand], onyxData: OnyxData = {}): void { Log.info('[API] Called API.read', false, {command, ...apiCommandParameters}); + // Apply optimistic updates of read requests immediately + const request = prepareRequest(command, CONST.API_REQUEST_TYPE.READ, apiCommandParameters, onyxData); waitForWrites(command).then(() => { - const request = prepareRequest(command, CONST.API_REQUEST_TYPE.READ, apiCommandParameters, onyxData); processRequest(request, CONST.API_REQUEST_TYPE.READ); }); }