Skip to content

Commit

Permalink
fix deferred object in uploadProject and downloadProject (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
yong-asial committed Sep 6, 2018
1 parent 68a9f9a commit 10e7322
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/monaca.js
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,11 @@
this.uploadFile(projectId, absolutePath, key)
.then(
function(remotePath) {
notifyDeferred = (options.deferred) ? options.deferred : deferred;
try {
notifyDeferred = (options && options.deferred) ? options.deferred : deferred;
} catch (e) {
notifyDeferred = deferred; // fallback
}
notifyDeferred.notify({
path: remotePath,
total: totalLength,
Expand Down Expand Up @@ -2161,7 +2165,11 @@

this.downloadFile(projectId, key, absolutePath).then(
function(remotePath) {
notifyDeferred = (options.deferred) ? options.deferred : deferred;
try {
notifyDeferred = (options && options.deferred) ? options.deferred : deferred;
} catch (e) {
notifyDeferred = deferred; // fallback
}
notifyDeferred.notify({
path: remotePath,
total: totalLength,
Expand Down

0 comments on commit 10e7322

Please sign in to comment.