From 712ce598a10710481707d7807949f455b5274f02 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Thu, 7 Aug 2025 13:30:40 +0700 Subject: [PATCH 1/2] fix: RBR appears when send image offline and back to online --- src/libs/prepareRequestPayload/index.native.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/prepareRequestPayload/index.native.ts b/src/libs/prepareRequestPayload/index.native.ts index 8a20342c91ba..906567e3d6fc 100644 --- a/src/libs/prepareRequestPayload/index.native.ts +++ b/src/libs/prepareRequestPayload/index.native.ts @@ -18,8 +18,8 @@ const prepareRequestPayload: PrepareRequestPayload = (command, data, initiatedOf return Promise.resolve(); } - if ((key === 'receipt' || key === 'file') && initiatedOffline) { - const {uri: path = '', source} = value as File; + const {uri: path = '', source} = value as File; + if ((key === 'receipt' || key === 'file') && !!source && initiatedOffline) { return readFileAsync(source, path, () => {}).then((file) => { if (!file) { From d958277b049cba3c52613bd144aa596b5fbaf6ab Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Thu, 7 Aug 2025 13:59:55 +0700 Subject: [PATCH 2/2] fix value is null --- src/libs/prepareRequestPayload/index.native.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/prepareRequestPayload/index.native.ts b/src/libs/prepareRequestPayload/index.native.ts index 906567e3d6fc..cc251762650a 100644 --- a/src/libs/prepareRequestPayload/index.native.ts +++ b/src/libs/prepareRequestPayload/index.native.ts @@ -18,9 +18,14 @@ const prepareRequestPayload: PrepareRequestPayload = (command, data, initiatedOf return Promise.resolve(); } - const {uri: path = '', source} = value as File; - if ((key === 'receipt' || key === 'file') && !!source && initiatedOffline) { - + if ((key === 'receipt' || key === 'file') && initiatedOffline) { + const {uri: path = '', source} = value as File; + if (!source) { + validateFormDataParameter(command, key, value); + formData.append(key, value as string | Blob); + + return Promise.resolve(); + } return readFileAsync(source, path, () => {}).then((file) => { if (!file) { return;