-
+
- Getting transactions...
-
-
+
Could not fetch transaction history
-
[Tap to retry]
+
Tap to retry
No transactions yet
@@ -386,30 +408,23 @@ history
-
+
-
-
-
-
- You do not have any wallet
-
-
Create
-
-
-
diff --git a/src/css/main.css b/src/css/main.css
index 0ce815506..75c1608f2 100644
--- a/src/css/main.css
+++ b/src/css/main.css
@@ -145,6 +145,15 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
position: relative;
}
+.content {
+ width:100%;
+ position: absolute;
+ top: 46px;
+ bottom: 0;
+ overflow: auto;
+}
+
+
.logo-setup {
text-align: center;
margin: 0 0 0.1rem 0;
@@ -355,6 +364,7 @@ ul.manage li {
.p70l {padding-left: 70px;}
.p5h {padding: 0 5px;}
.p20h {padding: 0 20px;}
+.p20v {padding: 20px 0;}
.p25l {padding-left: 25px;}
.p15 {padding:15px;}
.p20 {padding:20px;}
@@ -1108,12 +1118,12 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
.onGoingProcess {
background: #213140;
text-align: center;
- max-width: 14.5rem;
+ max-width: 16.5rem;
max-height: 3.5rem;
top:auto;
left:0;
right:0;
- bottom:90px;
+ bottom:170px;
margin: auto;
border-radius: 3px;
color: #fff;
@@ -1180,3 +1190,4 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
-webkit-transform: scaleY(1.0);
}
}
+
diff --git a/src/css/mobile.css b/src/css/mobile.css
index 3bffe52c9..76a2b1c9e 100644
--- a/src/css/mobile.css
+++ b/src/css/mobile.css
@@ -560,6 +560,7 @@ a.pin-button:active {
top: 0;
height: 100%;
overflow: auto;
+ padding-bottom: 20px;
}
.modal.fade,
@@ -688,8 +689,9 @@ a.pin-button:active {
width:100%;
position: absolute;
top: 46px;
- bottom: 80px;
+ bottom: 70px;
overflow: auto;
+ padding-bottom: 20px;
}
.tab-in {
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js
index d2b241eda..dd6c4b50d 100644
--- a/src/js/controllers/index.js
+++ b/src/js/controllers/index.js
@@ -72,9 +72,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.alternativeBalanceAvailable = false;
self.totalBalanceAlternative = null;
self.notAuthorized = false;
- self.clientError = null;
self.txHistory = [];
self.txHistoryPaging = false;
+ self.pendingTxProposalsCountForUs = null;
$timeout(function() {
self.hasProfile = true;
@@ -214,14 +214,18 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateTxHistory = function(skip) {
var fc = profileService.focusedClient;
+ if (!fc.isComplete()) return;
+
if (!skip) {
self.txHistory = [];
}
self.skipHistory = skip || 0;
+ $log.debug('Updating Transaction History');
+ self.txHistoryError = false;
+ self.updatingTxHistory = true;
+ self.txHistoryPaging = false;
$timeout(function() {
- $log.debug('Updating Transaction History');
- self.txHistoryError = false;
- self.updatingTxHistory = true;
+ $rootScope.$apply();
fc.getTxHistory({
skip: self.skipHistory,
limit: self.limitHistory + 1
@@ -411,17 +415,27 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
+ self.clientError = function (err) {
+ if (isCordova) {
+ navigator.notification.confirm(
+ err,
+ function() {},
+ 'Wallet Server Error', ['OK']
+ );
+ } else {
+ alert(err);
+ }
+ };
self.recreate = function(cb) {
var fc = profileService.focusedClient;
self.setOngoingProcess('recreating', true);
- self.clientError = null;
fc.recreateWallet(function(err) {
self.notAuthorized = false;
self.setOngoingProcess('recreating', false);
if (err) {
- self.clientError = 'Could not recreate wallet:' + err;
+ self.clientError('Could not recreate wallet:' + err);
$rootScope.$apply();
return;
}
@@ -458,7 +472,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (err) {
if (self.walletId == walletId)
self.setOngoingProcess('scanning', false);
- self.clientError = 'Could not scan wallet:' + err;
+ self.clientError('Could not scan wallet:' + err);
$rootScope.$apply();
}
});
@@ -522,7 +536,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on(eventName, function(event) {
$log.debug('### Online event');
self.isOffline = false;
- self.clientError = null;
self.updateAll();
self.updateTxHistory();
});
@@ -531,6 +544,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/Offline', function(event) {
$log.debug('Offline event');
self.isOffline = true;
+ $timeout(function(){
+ $rootScope.$apply();
+ });
});
$rootScope.$on('Local/BackupDone', function(event) {
@@ -544,7 +560,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
$rootScope.$on('Local/BWSNotFound', function(event) {
- self.clientError = 'Could not access to Bitcore Wallet Service: Service not found';
+ self.clientError('Could not access Wallet Service: Not found');
$rootScope.$apply();
});
@@ -557,7 +573,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
} else if (err.code === 'ETIMEDOUT') {
$log.debug('Time out:', err);
} else {
- self.clientError = err;
+ self.clientError(err && err.message ? 'Error at Wallet Service:' + err.message : err);
}
$rootScope.$apply();
});
@@ -627,7 +643,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$timeout(function() {
self.hasProfile = true;
self.noFocusedWallet = true;
- self.clientError = null;
self.isComplete = null;
self.walletName = null;
go.addWallet();
diff --git a/src/js/controllers/topbar.js b/src/js/controllers/topbar.js
index af4f625ed..8a9101f7e 100644
--- a/src/js/controllers/topbar.js
+++ b/src/js/controllers/topbar.js
@@ -124,4 +124,8 @@ angular.module('copayApp.controllers').controller('topbarController', function($
}
};
+ this.goHome = function() {
+ go.walletHome();
+ };
+
});
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js
index 7c554574d..81b209fb0 100644
--- a/src/js/controllers/walletHome.js
+++ b/src/js/controllers/walletHome.js
@@ -40,9 +40,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.getAddress();
});
+ var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() {
+ self.resetForm();
+ });
- var disableTabListener = $rootScope.$on('Local/TabChanged', function(e,tab){
- switch(tab) {
+ var disableTabListener = $rootScope.$on('Local/TabChanged', function(e, tab) {
+ switch (tab) {
case 'send':
self.resetError();
self.setInputs();
@@ -57,6 +60,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
disableScannerListener();
disablePaymentUriListener();
disableTabListener();
+ disableFocusListener();
$rootScope.hideMenuBar = false;
});
@@ -279,14 +283,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.newAddress = function() {
var fc = profileService.focusedClient;
- self.generatingAddress = true;
- self.error = null;
+ self.setOngoingProcess('Generating Address');
fc.createAddress(function(err, addr) {
- self.generatingAddress = false;
+ self.setOngoingProcess();
if (err) {
$log.debug('Creating address ERROR:', err);
$scope.$emit('Local/ClientError', err);
- self.error = 'Could not generate address';
} else {
self.addr = addr.address;
storageService.storeLastAddress(fc.credentials.walletId, addr.address, function() {});
@@ -434,16 +436,27 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.setOngoingProcess = function(name) {
var self = this;
- $timeout(function() {
- self.onGoingProcess = name;
- $rootScope.$apply();
- })
+ self.blockUx = !!name;
+
+ if (isCordova) {
+ if (name) {
+ window.plugins.spinnerDialog.show(null, name + '...', true);
+ } else {
+ window.plugins.spinnerDialog.hide();
+ }
+ } else {
+ $timeout(function() {
+ self.onGoingProcess = name;
+ $rootScope.$apply();
+ })
+ }
};
- this.submitForm = function(form) {
+ this.submitForm = function() {
var fc = profileService.focusedClient;
var unitToSat = this.unitToSatoshi;
+ var form = $scope.sendForm;
if (form.$invalid) {
this.error = 'Unable to send transaction proposal';
return;
@@ -452,18 +465,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
if (fc.isPrivKeyEncrypted()) {
profileService.unlockFC(function(err) {
if (err) return self.setError(err);
- return self.submitForm(form);
+ return self.submitForm();
});
return;
};
- self.blockUx = true;
- self.setOngoingProcess('Sending');
-
- if (isCordova) {
- window.plugins.spinnerDialog.show(null, 'Creating transaction...', true);
- }
-
+ self.setOngoingProcess('Sending transaction');
$timeout(function() {
var comment = form.comment.$modelValue;
var paypro = self._paypro;
@@ -481,24 +488,16 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess();
if (err) {
profileService.lockFC();
- if (isCordova) {
- window.plugins.spinnerDialog.hide();
- }
- self.blockUx = false;
return self.setError(err);
}
self.signAndBroadcast(txp, function(err) {
self.setOngoingProcess();
- if (isCordova) {
- window.plugins.spinnerDialog.hide();
- }
- self.blockUx = false;
+ profileService.lockFC();
if (err) {
- profileService.lockFC();
return self.setError(err);
}
- self.resetForm(form);
+ self.resetForm();
});
});
}, 100);
@@ -507,7 +506,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.signAndBroadcast = function(txp, cb) {
var fc = profileService.focusedClient;
- self.setOngoingProcess('Signing');
+ self.setOngoingProcess('Signing transaction');
fc.signTxProposal(txp, function(err, signedTx) {
profileService.lockFC();
self.setOngoingProcess();
@@ -515,7 +514,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
if (err) return cb(err);
if (signedTx.status == 'accepted') {
- self.setOngoingProcess('Broadcasting');
+ self.setOngoingProcess('Broadcasting transaction');
fc.broadcastTxProposal(signedTx, function(err, btx) {
self.setOngoingProcess();
if (err) {
@@ -570,9 +569,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
- this.resetForm = function(form) {
+ this.resetForm = function() {
this.resetError();
- this.fetchingURL = null;
this._paypro = null;
this.lockAddress = false;
@@ -580,6 +578,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this._amount = this._address = null;
+ var form = $scope.sendForm;
if (form && form.amount) {
form.amount.$pristine = true;
form.amount.$setViewValue('');
@@ -623,7 +622,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
});
};
- this.setFromPayPro = function(uri, form) {
+ this.setFromPayPro = function(uri) {
var fc = profileService.focusedClient;
if (isChromeApp) {
this.error = 'Payment Protocol not supported on Chrome App';
@@ -631,22 +630,19 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
}
var satToUnit = 1 / this.unitToSatoshi;
- this.fetchingURL = uri;
- this.blockUx = true;
var self = this;
+ self.setOngoingProcess('Fetching Payment Informantion');
$log.debug('Fetch PayPro Request...', uri);
$timeout(function() {
fc.fetchPayPro({
payProUrl: uri,
}, function(err, paypro) {
- $log.debug(paypro);
- self.blockUx = false;
- self.fetchingURL = null;
+ self.setOngoingProcess();
if (err) {
$log.warn(err);
- self.resetForm(form);
+ self.resetForm();
var msg = err.toString();
if (msg.match('HTTP')) {
msg = 'Could not fetch payment information';
diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js
index c5c3a9162..93dc7f87e 100644
--- a/src/js/directives/directives.js
+++ b/src/js/directives/directives.js
@@ -24,10 +24,10 @@ angular.module('copayApp.directives')
return {
require: 'ngModel',
link: function(scope, elem, attrs, ctrl) {
- var networkName = profileService.focusedClient.credentials.network;
var URI = bitcore.URI;
var Address = bitcore.Address
var validator = function(value) {
+ var networkName = profileService.focusedClient.credentials.network;
// Regular url
if (/^https?:\/\//.test(value)) {
ctrl.$setValidity('validAddress', true);
@@ -51,6 +51,7 @@ angular.module('copayApp.directives')
return;
}
+console.log('[directives.js.53]', value, networkName); //TODO
// Regular Address
ctrl.$setValidity('validAddress', Address.isValid(value, networkName));
return value;
diff --git a/src/js/models/profile.js b/src/js/models/profile.js
index e6bfd6087..c18967ded 100644
--- a/src/js/models/profile.js
+++ b/src/js/models/profile.js
@@ -34,7 +34,6 @@ Profile.fromString = function(str) {
};
Profile.prototype.toObj = function() {
-console.log('[profile.js.37:this:]',this); //TODO
return JSON.stringify(this);
};
diff --git a/src/js/routes.js b/src/js/routes.js
index a6ec1ce51..d68255875 100644
--- a/src/js/routes.js
+++ b/src/js/routes.js
@@ -192,7 +192,7 @@ angular
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Preferences';
- $scope.closeToState = 'walletHome';
+ $scope.closeToHome = true;
}
}
}
@@ -347,7 +347,7 @@ angular
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Add wallet';
- $scope.goBackToState = 'walletHome';
+ $scope.closeToHome = true;
}
}
}
diff --git a/src/js/services/go.js b/src/js/services/go.js
index 71482e8c9..d7139b00e 100644
--- a/src/js/services/go.js
+++ b/src/js/services/go.js
@@ -67,13 +67,6 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
});
};
- root.home = function() {
- if ($rootScope.iden)
- root.walletHome();
- else
- root.path('signin');
- };
-
root.addWallet = function() {
$state.go('add');
};