From cd867d0171e3614073b83220cabae98ccbb82976 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 23 Apr 2015 23:01:46 -0300 Subject: [PATCH] Revert "WIP: Bug/notif2" --- public/index.html | 3 ++ public/views/history.html | 1 + public/views/includes/clientError.html | 11 ++++ public/views/includes/offline.html | 11 ++++ public/views/walletHome.html | 74 +++++++++++--------------- src/css/main.css | 5 +- src/js/controllers/index.js | 26 +++------ 7 files changed, 67 insertions(+), 64 deletions(-) diff --git a/public/index.html b/public/index.html index 99add2264..4d55c0075 100644 --- a/public/index.html +++ b/public/index.html @@ -26,6 +26,9 @@
+
+
+
diff --git a/public/views/history.html b/public/views/history.html index e69de29bb..a9ea5e970 100644 --- a/public/views/history.html +++ b/public/views/history.html @@ -0,0 +1 @@ +
diff --git a/public/views/includes/clientError.html b/public/views/includes/clientError.html index e69de29bb..de193f2cf 100644 --- a/public/views/includes/clientError.html +++ b/public/views/includes/clientError.html @@ -0,0 +1,11 @@ +
+
+
+ +
+
+

Wallet Service Error

+
{{index.clientError.message || index.clientError}}
+
+
+
diff --git a/public/views/includes/offline.html b/public/views/includes/offline.html index e69de29bb..9e64e0cf3 100644 --- a/public/views/includes/offline.html +++ b/public/views/includes/offline.html @@ -0,0 +1,11 @@ +
+
+
+ +
+
+

{{'Could not connect to Wallet Service'|translate}}

+
{{'Trying to reconnnect...'|translate}}
+
+
+
diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 45c9fb79d..a05dad2e8 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -1,43 +1,6 @@
- -
-
- You do not have any wallet -
- -
- -
-
-
-
-
-
-
-
- Reconnecting to Wallet Server... -
- -
-
-
-
-
-
-
-
- Updating Wallet... - Scanning Wallet funds... - Recreating Wallet... -
- -
-
+
@@ -64,7 +27,7 @@ index.onGoingProcessName == 'openingWallet' ...
-
+
{{index.walletName | limitTo: 1}}
@@ -87,8 +50,23 @@ index.onGoingProcessName == 'openingWallet'
+
+
+
+
+
+
+
+
+ Updating Wallet... + Updating Status... + Updating Wallet... + Updating Wallet... + Scanning Wallet funds... + Recreating Wallet... +
-
+
@@ -196,7 +174,7 @@ index.onGoingProcessName == 'openingWallet'
@@ -339,7 +317,7 @@ index.onGoingProcessName == 'openingWallet' Cancel
- @@ -365,7 +343,7 @@ history Could not fetch transaction history -
Tap to retry +
[Tap to retry]
No transactions yet @@ -423,5 +401,15 @@ history
+ + +
+
+ You do not have any wallet +
+ +
+ +
diff --git a/src/css/main.css b/src/css/main.css index 25d60ef91..d41667a74 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1110,12 +1110,12 @@ input.ng-invalid-match, input.ng-invalid-match:focus { .onGoingProcess { background: #213140; text-align: center; - max-width: 16.5rem; + max-width: 14.5rem; max-height: 3.5rem; top:auto; left:0; right:0; - bottom:170px; + bottom:90px; margin: auto; border-radius: 3px; color: #fff; @@ -1123,7 +1123,6 @@ input.ng-invalid-match, input.ng-invalid-match:focus { font-size: 13px; position: absolute; opacity: 0.8; - z-index: 1000; } diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 5fbce2b62..d2b241eda 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -72,6 +72,7 @@ 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; @@ -410,27 +411,17 @@ 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; } @@ -467,7 +458,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(); } }); @@ -531,6 +522,7 @@ 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(); }); @@ -539,9 +531,6 @@ 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) { @@ -555,7 +544,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 to Bitcore Wallet Service: Service not found'; $rootScope.$apply(); }); @@ -568,7 +557,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r } else if (err.code === 'ETIMEDOUT') { $log.debug('Time out:', err); } else { - self.clientError(err && err.message ? 'Error at Bitcore Wallet Service:' + err.message : err); + self.clientError = err; } $rootScope.$apply(); }); @@ -638,6 +627,7 @@ 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();