Merge pull request #2608 from bitpay/revert-2605-bug/notif2
Revert "WIP: Bug/notif2"
This commit is contained in:
commit
839fdc61a3
7 changed files with 67 additions and 64 deletions
|
|
@ -26,6 +26,9 @@
|
|||
<div ng-include="'views/includes/sidebar.html'" ng-if="index.hasProfile"></div>
|
||||
|
||||
<div notifications="right top"></div>
|
||||
<div ng-include="'views/includes/offline.html'" ng-if="index.isOffline"></div>
|
||||
<div ng-include="'views/includes/clientError.html'" ng-if="index.clientError"></div>
|
||||
|
||||
<div ng-include="'views/includes/password.html'" ng-if="index.askPassword"
|
||||
></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<div class="extra-margin-bottom"></div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<div class="client-error dr-notification-wrapper">
|
||||
<div class="dr-notification">
|
||||
<div class="dr-notification-image">
|
||||
<i class="fi-alert"></i>
|
||||
</div>
|
||||
<div class="dr-notification-content">
|
||||
<h3 class="dr-notification-title">Wallet Service Error</h3>
|
||||
<div class="dr-notification-text ellipsis">{{index.clientError.message || index.clientError}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<div class="offline dr-notification-wrapper">
|
||||
<div class="dr-notification">
|
||||
<div class="dr-notification-image">
|
||||
<i class="fi-alert"></i>
|
||||
</div>
|
||||
<div class="dr-notification-content">
|
||||
<h3 class="dr-notification-title">{{'Could not connect to Wallet Service'|translate}}</h3>
|
||||
<div class="dr-notification-text ellipsis animated infinite flash">{{'Trying to reconnnect...'|translate}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,43 +1,6 @@
|
|||
<div ng-controller="walletHomeController as home">
|
||||
|
||||
<div class="row columns m20tp" ng-show="index.noFocusedWallet">
|
||||
<div class="text-center text-warning m20b">
|
||||
<i class="fi-alert"></i> <span translate>You do not have any wallet</span>
|
||||
</div>
|
||||
<button class="button black expand" ng-click="$root.go('add')" translate>Create</button>
|
||||
</div>
|
||||
|
||||
<div class="onGoingProcess" ng-show="index.isOffline" style="background-color:#222">
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
<div class="rect2"></div>
|
||||
<div class="rect3"></div>
|
||||
<div class="rect4"></div>
|
||||
<div class="rect5"></div>
|
||||
</div>
|
||||
<span translate>Reconnecting to Wallet Server...</span>
|
||||
</div>
|
||||
|
||||
<div class="onGoingProcess" ng-show="index.anyOnGoingProcess && !index.isOffline" ng-style="{'background-color':index.backgroundColor}">
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
<div class="rect2"></div>
|
||||
<div class="rect3"></div>
|
||||
<div class="rect4"></div>
|
||||
<div class="rect5"></div>
|
||||
</div>
|
||||
<span translate ng-show="
|
||||
index.onGoingProcessName == 'openingWallet'
|
||||
|| index.onGoingProcessName == 'updatingStatus'
|
||||
|| index.onGoingProcessName == 'updatingBalance'
|
||||
"> Updating Wallet... </span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet...</span>
|
||||
</div>
|
||||
|
||||
<div class="oh" ng-show="!index.noFocusedWallet">
|
||||
|
||||
<div id="walletHome" class="walletHome tab-view tab-in">
|
||||
<div class="oh" ng-show="!index.noFocusedWallet">
|
||||
<div class="amount" ng-style="{'background-color':index.backgroundColor}">
|
||||
<div ng-if="!index.anyOnGoingProcess && !index.notAuthorized">
|
||||
<div ng-show="index.updateError" ng-click='index.openWallet()'>
|
||||
|
|
@ -64,7 +27,7 @@ index.onGoingProcessName == 'openingWallet'
|
|||
<strong>...</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- amount -->
|
||||
</div>
|
||||
<div class="pr columns line-b">
|
||||
<div class="avatar-wallet left"
|
||||
ng-style="{'background-color':index.backgroundColor}">{{index.walletName | limitTo: 1}}</div>
|
||||
|
|
@ -87,8 +50,23 @@ index.onGoingProcessName == 'openingWallet'
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="onGoingProcess" ng-show="index.anyOnGoingProcess" ng-style="{'background-color':index.backgroundColor}">
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
<div class="rect2"></div>
|
||||
<div class="rect3"></div>
|
||||
<div class="rect4"></div>
|
||||
<div class="rect5"></div>
|
||||
</div>
|
||||
<span translate ng-show="index.onGoingProcessName == 'openingWallet'"> Updating Wallet... </span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingStatus'"> Updating Status...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingBalance'">Updating Wallet... </span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingPendingTxps'">Updating Wallet...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet...</span>
|
||||
</div>
|
||||
|
||||
<div class="m20t" ng-show="index.notAuthorized && ! index.anyOnGoingProcess">
|
||||
<div class="m20t" ng-show="index.notAuthorized">
|
||||
<div class="text-center text-warning">
|
||||
<i class="fi-alert"></i>
|
||||
<span translate>
|
||||
|
|
@ -196,7 +174,7 @@ index.onGoingProcessName == 'openingWallet'
|
|||
<div class="row m20t" ng-if="home.addr">
|
||||
<div class="large-12 columns">
|
||||
<button class="button black expand radius" ng-click="home.newAddress()"
|
||||
ng-style="{'background-color':index.backgroundColor}" ng-disabled="home.generatingAddress || index.isOffline" translate>
|
||||
ng-style="{'background-color':index.backgroundColor}" ng-disabled="home.generatingAddress" translate>
|
||||
Generate new address
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -339,7 +317,7 @@ index.onGoingProcessName == 'openingWallet'
|
|||
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray" translate>Cancel</a>
|
||||
</div>
|
||||
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress)}">
|
||||
<button type="submit" class="button black radius expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline"
|
||||
<button type="submit" class="button black radius expand" ng-disabled="sendForm.$invalid || home.blockUx"
|
||||
ng-style="{'background-color':index.backgroundColor}" translate>
|
||||
Send
|
||||
</button>
|
||||
|
|
@ -365,7 +343,7 @@ history
|
|||
<span ng-if="!index.updatingTxHistory">
|
||||
<span ng-show="index.txHistoryError && !index.notAuthorized" ng-click='index.openWallet()'>
|
||||
<span translate>Could not fetch transaction history</span>
|
||||
<br> <span translate>Tap to retry</span>
|
||||
<br> [<span translate>Tap to retry</span>]
|
||||
</span>
|
||||
<span ng-if="!index.txHistoryError" translate>
|
||||
No transactions yet
|
||||
|
|
@ -423,5 +401,15 @@ history
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- END -->
|
||||
<div class="row columns m20tp" ng-show="index.noFocusedWallet">
|
||||
<div class="text-center text-warning m20b">
|
||||
<i class="fi-alert"></i> <span translate>You do not have any wallet</span>
|
||||
</div>
|
||||
<button class="button black expand" ng-click="$root.go('add')" translate>Create</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue