jmuehlner commented on code in PR #746:
URL: https://github.com/apache/guacamole-client/pull/746#discussion_r930363675


##########
guacamole/src/main/frontend/src/app/rest/services/tunnelService.js:
##########
@@ -301,51 +310,73 @@ angular.module('rest').factory('tunnelService', 
['$injector',
                 + '/' + encodeURIComponent(sanitizeFilename(file.name))
                 + '?token=' + 
encodeURIComponent(authenticationService.getCurrentToken());
 
-        var xhr = new XMLHttpRequest();
-
-        // Invoke provided callback if upload tracking is supported
-        if (progressCallback && xhr.upload) {
-            xhr.upload.addEventListener('progress', function updateProgress(e) 
{
-                progressCallback(e.loaded);
-            });
+        // Creates the chunk to be uploaded
+        const createChunk = (offset) => {

Review Comment:
   Even functions that are not exposed on the scope should have block comments 
just like any other.
   
   Also, just from a readability perspective, it is a little odd to have a 
function called `createChunk` actually do the uploading as well. I think it'd 
be easier to understand what's going on here if `createChunk` returned a chunk, 
and then the caller recursively called `uploadChunk` again.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to