diff --git a/public/views/create.html b/public/views/create.html index 35267fb1b..62ca0fcf0 100644 --- a/public/views/create.html +++ b/public/views/create.html @@ -14,7 +14,7 @@ -
+
diff --git a/public/views/includes/topbar.html b/public/views/includes/topbar.html index 518ac924c..68b6e56ce 100644 --- a/public/views/includes/topbar.html +++ b/public/views/includes/topbar.html @@ -19,7 +19,7 @@
-

+

{{(titleSection|translate) || index.walletName}}

diff --git a/public/views/join.html b/public/views/join.html index b7f3a4872..a682c1e9a 100644 --- a/public/views/join.html +++ b/public/views/join.html @@ -12,7 +12,7 @@
-
+
diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 6f9a6c7c2..7e551fd4c 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -39,7 +39,7 @@
-
+
@@ -189,32 +189,29 @@

My Bitcoin address

-
+
-
-

{{home.addr}}

-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
- -
-

...

+
+

+ {{home.generatingAddress ? '...' : home.addr}} + +

- +
@@ -265,7 +262,7 @@
- +
{{home.error|translate}} diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 71edde1f4..82c5cfb63 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -649,7 +649,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.updateAll(); $timeout(function() { self.updateTxHistory(); - }, 5000); + }, 3000); }); }); diff --git a/src/js/controllers/join.js b/src/js/controllers/join.js index 870d1af43..2a24a46c1 100644 --- a/src/js/controllers/join.js +++ b/src/js/controllers/join.js @@ -145,14 +145,15 @@ angular.module('copayApp.controllers').controller('joinController', extendedPrivateKey: form.privateKey.$modelValue, myName: form.myName.$modelValue }, function(err) { - self.loading = false; if (err) { + self.loading = false; self.error = 'Could not join wallet: ' + (err.message ? err.message : err); $rootScope.$apply(); + return } - else { + $timeout(function() { go.walletHome(); - } + }, 2000); }); }, 100); } diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 1bee29b84..3c6b076bc 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -486,17 +486,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi message: comment, payProUrl: paypro ? paypro.url : null, }, function(err, txp) { - self.setOngoingProcess(); if (err) { + self.setOngoingProcess(); profileService.lockFC(); return self.setError(err); } self.signAndBroadcast(txp, function(err) { - profileService.lockFC(); if (err) { + self.setOngoingProcess(); return self.setError(err); } + self.resetForm(); }); }); @@ -509,43 +510,37 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi self.setOngoingProcess('Signing transaction'); fc.signTxProposal(txp, function(err, signedTx) { profileService.lockFC(); - self.setOngoingProcess(); if (err) { + self.setOngoingProcess(); return cb(err); } if (signedTx.status == 'accepted') { self.setOngoingProcess('Broadcasting transaction'); fc.broadcastTxProposal(signedTx, function(err, btx) { - self.setOngoingProcess(); if (err) { + self.setOngoingProcess(); $scope.error = 'Transaction not broadcasted. Please try again.'; $scope.$digest(); - } else { - txStatus.notify(btx); - $scope.$emit('Local/TxProposalAction'); + return; } - return cb(); + $scope.$emit('Local/TxProposalAction'); + txStatus.notify(btx, function() { + self.setOngoingProcess(); + return cb(); + }); }); } else { - txStatus.notify(signedTx); $scope.$emit('Local/TxProposalAction'); - return cb(); + txStatus.notify(signedTx, function() { + self.setOngoingProcess(); + return cb(); + }); } }); }; - this.setTopAmount = function() { - throw new Error('todo: setTopAmount'); - var form = $scope.sendForm; - if (form) { - form.amount.$setViewValue(w.balanceInfo.topAmount); - form.amount.$render(); - form.amount.$isValid = true; - } - }; - this.setForm = function(to, amount, comment) { var form = $scope.sendForm; if (to) { diff --git a/src/js/routes.js b/src/js/routes.js index 7f075b2c8..5218d468d 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -30,11 +30,15 @@ angular var orig = $delegate[level]; $delegate[level] = function() { var args = [].slice.call(arguments); + if (!Array.isArray(args)) args = [args]; args = args.map(function(v) { try { if (typeof v == 'undefined') v = 'undefined'; if (typeof v == 'object') { - v = JSON.stringify(v); + if (v.message) + v = v.message; + else + v = JSON.stringify(v); } v = v.toString(); if (v.length > 200) @@ -48,7 +52,7 @@ angular try { if (window.cordova) console.log(args.join(' ')); - orig.apply(null, args) + orig.apply(null, args); historicLog.add(level, args.join(' ')); } catch (e) { console.log('Error at log decorator:', e); @@ -96,6 +100,7 @@ angular templateUrl: 'views/createProfile.html', controller: function($scope) { $scope.mainDark = true; + $scope.noColor = true; } } } @@ -120,6 +125,7 @@ angular templateUrl: 'views/includes/topbar.html', controller: function($scope) { $scope.goBackToState = 'walletHome'; + $scope.noColor = true; } } }, @@ -142,6 +148,7 @@ angular controller: function($scope) { $scope.titleSection = 'Join shared wallet'; $scope.goBackToState = 'add'; + $scope.noColor = true; } } } @@ -158,6 +165,7 @@ angular controller: function($scope) { $scope.titleSection = 'Import wallet'; $scope.goBackToState = 'add'; + $scope.noColor = true; } } } @@ -179,6 +187,7 @@ angular controller: function($scope) { $scope.titleSection = 'Import legacy wallet'; $scope.goBackToState = 'add'; + $scope.noColor = true; } } } @@ -197,6 +206,7 @@ angular controller: function($scope) { $scope.titleSection = 'Create new wallet'; $scope.goBackToState = 'add'; + $scope.noColor = true; } } } @@ -213,12 +223,6 @@ angular } } }) - .state('profile', { - url: '/profile', - controller: 'profileController', - templateUrl: 'views/profile.html', - needProfile: true - }) .state('preferences', { url: '/preferences', templateUrl: 'views/preferences.html', @@ -250,6 +254,7 @@ angular controller: function($scope) { $scope.titleSection = 'Language'; $scope.goBackToState = 'preferences'; + $scope.noColor = true; } } } @@ -268,6 +273,7 @@ angular controller: function($scope) { $scope.titleSection = 'Unit'; $scope.goBackToState = 'preferences'; + $scope.noColor = true; } } } @@ -305,6 +311,7 @@ angular controller: function($scope) { $scope.titleSection = 'Alternative Currency'; $scope.goBackToState = 'preferences'; + $scope.noColor = true; } } } @@ -323,6 +330,7 @@ angular controller: function($scope) { $scope.titleSection = 'Bitcore Wallet Service'; $scope.goBackToState = 'preferences'; + $scope.noColor = true; } } } @@ -359,6 +367,7 @@ angular controller: function($scope) { $scope.titleSection = 'About'; $scope.goBackToState = 'preferences'; + $scope.noColor = true; } } } @@ -377,6 +386,7 @@ angular controller: function($scope) { $scope.titleSection = 'Logs'; $scope.goBackToState = 'about'; + $scope.noColor = true; } } } @@ -424,6 +434,7 @@ angular controller: function($scope) { $scope.titleSection = 'Add wallet'; $scope.closeToHome = true; + $scope.noColor = true; } } } diff --git a/src/js/services/txStatus.js b/src/js/services/txStatus.js index 9f048dce3..3e76a8933 100644 --- a/src/js/services/txStatus.js +++ b/src/js/services/txStatus.js @@ -1,18 +1,17 @@ 'use strict'; -angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService) { +angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService, $timeout) { var root = {}; - root.notify = function(txp) { + root.notify = function(txp, cb) { var fc = profileService.focusedClient; var msg; var status = txp.status; - + if (status == 'broadcasted') { msg = 'Transaction broadcasted'; - } - else { + } else { var action = lodash.find(txp.actions, { copayerId: fc.credentials.copayerId }); @@ -25,16 +24,16 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash, } } - if (msg) - root.openModal(msg); + root.openModal(msg, cb); }; - root.openModal = function(statusStr) { + root.openModal = function(statusStr, cb) { var ModalInstanceCtrl = function($scope, $modalInstance) { $scope.statusStr = statusStr; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; + if (cb) $timeout(cb, 100); }; $modal.open({ templateUrl: 'views/modals/tx-status.html',