Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
#9 Fixed issue with update progress calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Kandziora committed May 27, 2015
1 parent 7f4e0fb commit 39e7fa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ionic-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,19 @@ angular.module('ionic.service.deploy', ['ionic.service.core'])
IonicDeploy.check($ionicApp.getApp().app_id, function(result) {
if (result === 'true') {
// There are updates, download them
var progress = 0;
var downloadProgress = 0;
IonicDeploy.download($ionicApp.getApp().app_id, function(result) {
if (result !== 'true' && result !== 'false') {
// Download is only half of the reported progress
progress = progress + (result / 2);
deferred.notify(progress);
downloadProgress = (result / 2);
deferred.notify(downloadProgress);
} else {
// Download complete, now extract
console.log("Download complete");
IonicDeploy.extract($ionicApp.getApp().app_id, function(result) {
if (result !== 'done') {
// Extract is only half of the reported progress
progress = progress + (result / 2);
var progress = downloadProgress + (result / 2);
deferred.notify(progress);
} else {
console.log("Extract complete");
Expand Down

0 comments on commit 39e7fa8

Please sign in to comment.