From 539995d0b1cac15c99d7ab804355ac8789db6ab0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 4 Mar 2024 11:53:18 +0530 Subject: [PATCH] fix/added progresscallback function --- how-to/upload-encrypted-data/file.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to/upload-encrypted-data/file.md b/how-to/upload-encrypted-data/file.md index 5a168b4..2bd7af0 100644 --- a/how-to/upload-encrypted-data/file.md +++ b/how-to/upload-encrypted-data/file.md @@ -80,6 +80,13 @@ function App() { // Define your API Key (should be replaced with secure environment variables in production) const apiKey = process.env.REACT_APP_API_KEY +//progressCallback in percentage + const progressCallback = (progressData) => { + let percentageDone = + 100 - (progressData?.total / progressData?.uploaded)?.toFixed(2) + console.log(percentageDone) + } + // Function to sign the authentication message using Wallet const signAuthMessage = async () => { if (window.ethereum) {