diff --git a/JSDemos/Demos/FileManager/AzureClientBinding/React/App.tsx b/JSDemos/Demos/FileManager/AzureClientBinding/React/App.tsx index 71b7bb9a759..c4871ba62ae 100644 --- a/JSDemos/Demos/FileManager/AzureClientBinding/React/App.tsx +++ b/JSDemos/Demos/FileManager/AzureClientBinding/React/App.tsx @@ -56,11 +56,13 @@ function App() { promise = Promise.resolve(); } - promise = promise.then(() => gateway.putBlock( // - uploadInfo.customData.accessUrl, - uploadInfo.chunkIndex, - uploadInfo.chunkBlob, - )); + promise = promise.then(() => { + const accessUrl = uploadInfo.customData.accessUrl; + return gateway.putBlock( + accessUrl, + uploadInfo.chunkIndex, + uploadInfo.chunkBlob, + )}); if (uploadInfo.chunkIndex === uploadInfo.chunkCount - 1) { promise = promise.then(() => gateway.putBlockList( diff --git a/JSDemos/Demos/FileManager/AzureClientBinding/ReactJs/App.js b/JSDemos/Demos/FileManager/AzureClientBinding/ReactJs/App.js index ed5d3d6039f..d3a422fe219 100644 --- a/JSDemos/Demos/FileManager/AzureClientBinding/ReactJs/App.js +++ b/JSDemos/Demos/FileManager/AzureClientBinding/ReactJs/App.js @@ -52,13 +52,10 @@ function App() { } else { promise = Promise.resolve(); } - promise = promise.then(() => - gateway.putBlock( - // - uploadInfo.customData.accessUrl, - uploadInfo.chunkIndex, - uploadInfo.chunkBlob, - )); + promise = promise.then(() => { + const accessUrl = uploadInfo.customData.accessUrl; + return gateway.putBlock(accessUrl, uploadInfo.chunkIndex, uploadInfo.chunkBlob); + }); if (uploadInfo.chunkIndex === uploadInfo.chunkCount - 1) { promise = promise.then(() => gateway.putBlockList(uploadInfo.customData.accessUrl, uploadInfo.chunkCount));