Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/118#discussion_r46454382 --- Diff: src/windows/FileTransferProxy.js --- @@ -49,6 +49,17 @@ function nativePathToCordova(path) { return String(path).replace(/\\/g, '/'); } +function alreadyCancelled(opId, errorCb, filePath, server) { + var op = fileTransferOps[opId]; + if (op && op.state === FileTransferOperation.CANCELLED) { + // Here we should call errorCB with ABORT_ERR error + errorCb(new FTErr(FTErr.ABORT_ERR, nativePathToCordova(filePath), server)); --- End diff -- This side effect should not be part of the function. Please place it outside, into the calling code. It will be duplicated, but that is still somewhat OK; it's definitely better than someone calling if `alreadyCancelled()` twice in a row and getting their callback called twice.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org