From 380a070e7192b39317c84d5dd7b86bcc43dc39dd Mon Sep 17 00:00:00 2001 From: Nischay Date: Sun, 21 Apr 2024 11:23:11 +0530 Subject: [PATCH] Improve comments --- web/src/widget-api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/widget-api.js b/web/src/widget-api.js index cb8064d..3ea51e4 100644 --- a/web/src/widget-api.js +++ b/web/src/widget-api.js @@ -35,14 +35,14 @@ export function sendGIF(url){ if (xhr.readyState === 4) { if (xhr.status === 200) { const responseData = xhr.responseText; - // Call function A with the response data + // Call uploadFile with response data api.uploadFile(responseData) .then(result => { console.log("Here's the result:"+result); - resolve(result); // Resolve the outer promise with the result from A + resolve(result); }) .catch(error => { - reject(error); // Reject the outer promise if function A fails + reject(error); }); } else { reject(new Error('Failed to fetch data')); // Reject the outer promise if fetching data fails