Merge pull request #2510 from matiu/feat/networking01
Feat/networking01
This commit is contained in:
commit
519ccc14b1
19 changed files with 163 additions and 110 deletions
|
|
@ -28,9 +28,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.hasProfile && index.isOffLine"></div>
|
||||
<div ng-include="'views/includes/clientError.html'"
|
||||
ng-if="index.hasProfile && !index.isOffLine && index.clientError"></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>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div ng-controller="copayersController as copayers" ng-init="copayers.init()"
|
||||
ng-if="!index.isOffLine && !index.clientError">
|
||||
ng-if="!index.clientError">
|
||||
|
||||
<div ng-show="!index.notAuthorized">
|
||||
<div class="row m10t text-center">
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@
|
|||
<img src="img/logo-negative-beta.svg" alt="Copay" width="100">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
<div ng-if="index.isOffLine" class="row">
|
||||
<div class="large-12 columns">
|
||||
<h1 class="text-center text-warning" translate>Warning</h1>
|
||||
<div class="panel">
|
||||
<p translate>You don’t have an internet connection active. Copay needs connection to create a wallet</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center size-12 text-warning" ng-show="cp.error">
|
||||
{{(cp.error)|translate}}. Retrying...
|
||||
</div>
|
||||
<!-- <div ng-if="!index.isOffLine && !cp.creatingProfile" ng-include="'views/includes/pin.html'" ng-init="confirmPin=true"></div> -->
|
||||
<div class="m20tp text-white text-center animated infinite flash" ng-if="!index.isOffLine && cp.creatingProfile">
|
||||
|
||||
<div class="m20tp text-white text-center animated infinite flash" ng-if="cp.creatingProfile">
|
||||
<span translate>Creating wallet...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,16 @@
|
|||
<div class="row m20t" ng-show="!index.txHistory[0]">
|
||||
<div class="large-12 columns">
|
||||
<div class="oh text-center">
|
||||
<span ng-if="index.updatingTxHistory" class="text-gray" translate>Getting transactions...</span>
|
||||
<span ng-if="!index.updatingTxHistory">No transactions yet</span>
|
||||
<span ng-if="index.updatingTxHistory" class="text-gray animated flash infinite" translate>Getting transactions...</span>
|
||||
<span ng-if="!index.updatingTxHistory">
|
||||
<div ng-show="index.txHistoryError && !index.notAuthorized" ng-click='index.openWallet()'>
|
||||
Could not fetch transaction history
|
||||
<br> [Tap to retry]
|
||||
</span>
|
||||
<span ng-if="!index.txHistoryError">
|
||||
No transactions yet
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -22,7 +30,7 @@
|
|||
<span class="size-18">
|
||||
<span ng-if="btx.action == 'received'">+</span>
|
||||
<span ng-if="btx.action == 'sent'">-</span>
|
||||
{{history.formatAmount(btx.amount)}}
|
||||
{{btx.amountStr}}
|
||||
{{history.getUnitName()}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<i class="fi-alert"></i>
|
||||
</div>
|
||||
<div class="dr-notification-content">
|
||||
<h3 class="dr-notification-title">Connection error</h3>
|
||||
<h3 class="dr-notification-title">Wallet Service Error</h3>
|
||||
<div class="dr-notification-text ellipsis">{{index.clientError.message || index.clientError}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
<i class="fi-alert"></i>
|
||||
</div>
|
||||
<div class="dr-notification-content">
|
||||
<h3 class="dr-notification-title">{{'No internet connection'|translate}}</h3>
|
||||
<div class="dr-notification-text ellipsis">{{'Copay needs connection to run basic functions'|translate}}</div>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="size-12">{{item.m}} of {{item.n}}</div>
|
||||
</a>
|
||||
</li>
|
||||
<li ng-if="!index.isOffLine">
|
||||
<li>
|
||||
<a ng-click="$root.go('add')">
|
||||
<i class="icon-arrow-right3 size-18 right m10t"></i>
|
||||
<i class="fi-plus size-24 db left m10r"></i>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,15 @@
|
|||
</div>
|
||||
</div>
|
||||
<div ng-show="!receive.generatingAddress">
|
||||
<div class="box-notification" ng-show="receive.error ">
|
||||
<div class="box-icon error">
|
||||
<i class="fi-x size-24"></i>
|
||||
</div>
|
||||
<span class="text-warning size-14">
|
||||
{{receive.error|translate}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="receive.addr">
|
||||
<!-- Address-->
|
||||
<div class="large-12 columns">
|
||||
|
|
@ -56,7 +65,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m20t" ng-show="receive.addr && !index.isOffLine && !index.clientError">
|
||||
<div class="row m20t" ng-show="receive.addr">
|
||||
<div class="large-12 columns">
|
||||
<a class="button black expand radius" ng-click="receive.newAddress()"
|
||||
ng-style="{'background-color':index.backgroundColor}" translate>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="send" ng-controller="sendController as send" ng-init="send.init()" ng-show="!index.isOffLine">
|
||||
<div class="send" ng-controller="sendController as send" ng-init="send.init()">
|
||||
<div ng-show="index.lockedBalance">
|
||||
<h4 class="title m0">
|
||||
<div class="left">
|
||||
|
|
@ -152,6 +152,4 @@
|
|||
</div>
|
||||
<!-- end of row -->
|
||||
</div>
|
||||
<div ng-if="index.isOffLine" class="m20tp text-center" translate>Checking your internet connection...</div>
|
||||
|
||||
<div class="extra-margin-bottom"></div>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,31 @@
|
|||
<div class="home-wallet" ng-controller="walletHomeController as home" ng-init="home.init()">
|
||||
<div class="row" ng-show="!index.noFocusedWallet">
|
||||
<div class="amount" ng-style="{'background-color':index.backgroundColor}">
|
||||
<div class="size-36">
|
||||
|
||||
<div ng-show="index.updateError && !index.notAuthorized" ng-click='index.openWallet()'>
|
||||
Could not update Wallet
|
||||
<br> [Tap to retry]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="size-36" ng-show="!index.anyOnGoingProcess">
|
||||
<strong>
|
||||
<span ng-show="!index.hideBalance">
|
||||
<span ng-class="{'animated pulse':!index.hideBalance}">{{index.totalBalanceStr || '...'}}</span>
|
||||
<span>
|
||||
<span ng-class="{'animated pulse':!index.anyOnGoingProcess}">{{index.totalBalanceStr }}</span>
|
||||
</span>
|
||||
<span ng-show="index.hideBalance">...</span>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="size-14" ng-show="!index.hideBalance">
|
||||
<span ng-if="index.alternativeBalanceAvailable" ng-class="{'animated fadeIn':!index.hideBalance}">{{index.totalBalanceAlternative}} {{index.alternativeIsoCode}}</span>
|
||||
<span ng-if="!index.alternativeBalanceAvailable">N/A</span>
|
||||
<div class="text-white text-center animated infinite flash" ng-show="index.anyOnGoingProcess" >
|
||||
<span translate ng-show="index.onGoingProcessName == 'openingWallet'">Opening Wallet...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingStatus'">Updating Status...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingBalance'">Updating Balance...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingPendingTxps'">Updating Pending Transactions...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet on BWS...</span>
|
||||
</div>
|
||||
<div class="size-14" ng-show="index.hideBalance">
|
||||
|
||||
<div class="size-14" ng-show="!index.anyOnGoingProcess">
|
||||
<span ng-if="index.alternativeBalanceAvailable" ng-class="{'animated fadeIn':!index.hideBalance}">{{index.totalBalanceAlternative}} {{index.alternativeIsoCode}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pr columns line-b">
|
||||
|
|
@ -39,7 +50,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-show="index.notAuthorized">
|
||||
<div class="text-center text-warning">
|
||||
<i class="fi-alert"></i>
|
||||
|
|
@ -99,16 +109,6 @@ You can recreate it from the local information.
|
|||
<button class="button black expand" ng-click="$root.go('add')" translate>Create</button>
|
||||
</div>
|
||||
|
||||
<div class="text-gray text-center m10t animated infinite flash" ng-show="index.anyOnGoingProcess" >
|
||||
<span translate ng-show="index.onGoingProcessName == 'openingWallet'">Opening Wallet...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingStatus'">Updating Status...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingBalance'">Updating Balance...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'updatingPendingTxps'">Updating Pending Transactions...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
||||
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet on BWS...</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
|
|
|
|||
|
|
@ -1137,3 +1137,4 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
|
|||
.tx-details-blockchain li {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ _:-ms-fullscreen, :root .main {
|
|||
padding: 3rem 1rem;
|
||||
margin-bottom: 11px;
|
||||
color: #fff;
|
||||
height: 175px;
|
||||
}
|
||||
|
||||
.scroll-section {
|
||||
|
|
@ -476,8 +477,10 @@ a.pin-button:active {
|
|||
|
||||
.dr-notification-wrapper.offline {
|
||||
position: absolute;
|
||||
top: 45px;
|
||||
z-index: 11;
|
||||
top: 0px;
|
||||
z-index: 2000;
|
||||
opacity: 1.0 !important;
|
||||
background-color: #2C3E50;
|
||||
}
|
||||
|
||||
.dr-notification-wrapper.client-error {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ angular.module('copayApp.controllers').controller('historyController',
|
|||
|
||||
var fc = profileService.focusedClient;
|
||||
var config = configService.getSync().wallet.settings;
|
||||
var formatAmount = profileService.formatAmount;
|
||||
this.unitToSatoshi = config.unitToSatoshi;
|
||||
this.satToUnit = 1 / this.unitToSatoshi;
|
||||
this.unitName = config.unitName;
|
||||
|
|
@ -42,10 +41,9 @@ angular.module('copayApp.controllers').controller('historyController',
|
|||
this.openTxModal = function(btx) {
|
||||
var self = this;
|
||||
var fc = profileService.focusedClient;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, profileService) {
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.btx = btx;
|
||||
$scope.settings = config;
|
||||
$scope.btx.amountStr = profileService.formatAmount(btx.amount);
|
||||
$scope.color = fc.backgroundColor;
|
||||
|
||||
$scope.getAmount = function(amount) {
|
||||
|
|
@ -73,11 +71,6 @@ angular.module('copayApp.controllers').controller('historyController',
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
this.formatAmount = function(amount) {
|
||||
return profileService.formatAmount(amount);
|
||||
};
|
||||
|
||||
this.hasAction = function(actions, action) {
|
||||
return actions.hasOwnProperty('create');
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self[processName] = isOn;
|
||||
self.onGoingProcess[processName] = isOn;
|
||||
|
||||
// derived rules
|
||||
self.hideBalance = self.updatingBalance || self.updatingStatus || self.openingWallet;
|
||||
|
||||
var name;
|
||||
self.anyOnGoingProcess = lodash.any(self.onGoingProcess, function(isOn, processName) {
|
||||
if (isOn)
|
||||
|
|
@ -26,6 +23,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
// The first one
|
||||
self.onGoingProcessName = name;
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
});
|
||||
};
|
||||
|
||||
self.setFocusedWallet = function() {
|
||||
|
|
@ -69,8 +69,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
var get = function(cb) {
|
||||
if (walletStatus)
|
||||
return cb(null, walletStatus);
|
||||
else
|
||||
return fc.getStatus(cb);
|
||||
else {
|
||||
self.updateError = false;
|
||||
return fc.getStatus(function(err, ret) {
|
||||
if (err) self.updateError = true;
|
||||
return cb(err, ret);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var fc = profileService.focusedClient;
|
||||
|
|
@ -142,18 +147,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
}
|
||||
self.skipHistory = skip || 0;
|
||||
$timeout(function() {
|
||||
self.setOngoingProcess('updatingTxHistory', true);
|
||||
$log.debug('Updating Transaction History');
|
||||
self.txHistoryError = false;
|
||||
self.updatingTxHistory = true;
|
||||
fc.getTxHistory({
|
||||
skip: self.skipHistory,
|
||||
limit: self.limitHistory + 1
|
||||
}, function(err, txs) {
|
||||
self.setOngoingProcess('updatingTxHistory', false);
|
||||
self.updatingTxHistory = false;
|
||||
if (err) {
|
||||
$log.debug('TxHistory ERROR:', err);
|
||||
$scope.$emit('Local/ClientError', err);
|
||||
}
|
||||
else {
|
||||
self.handleError(err);
|
||||
self.txHistoryError = true;
|
||||
} else {
|
||||
$log.debug('Wallet Transaction History:', txs);
|
||||
self.skipHistory = self.skipHistory + self.limitHistory;
|
||||
self.setTxHistory(txs);
|
||||
|
|
@ -169,8 +175,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
$scope.$emit('Local/NotAuthorized');
|
||||
} else if (err.code === 'NOTFOUND') {
|
||||
$scope.$emit('Local/BWSNotFound');
|
||||
} else if (err.code === 'ETIMEDOUT') {
|
||||
$scope.$emit('Local/BWSTimeOut');
|
||||
} else {
|
||||
$scope.$emit('Local/ClientError', err);
|
||||
}
|
||||
|
|
@ -180,9 +184,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.updateColor();
|
||||
$timeout(function() {
|
||||
self.setOngoingProcess('openingWallet', true);
|
||||
self.updateError = false;
|
||||
fc.openWallet(function(err, walletStatus) {
|
||||
self.setOngoingProcess('openingWallet', false);
|
||||
if (err) {
|
||||
self.updateError = true;
|
||||
self.handleError(err);
|
||||
return;
|
||||
}
|
||||
|
|
@ -342,6 +348,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.notAuthorized = false;
|
||||
self.setOngoingProcess('recreating', false);
|
||||
|
||||
if (err) {
|
||||
self.clientError = 'Could not recreate wallet:' + err;
|
||||
$rootScope.$apply();
|
||||
return;
|
||||
}
|
||||
|
||||
profileService.setWalletClients();
|
||||
$timeout(function() {
|
||||
$rootScope.$emit('Local/WalletImported', self.walletId);
|
||||
|
|
@ -371,6 +383,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
c.scanning = false;
|
||||
if (self.walletId == walletId)
|
||||
self.setOngoingProcess('scanning', false);
|
||||
self.clientError = 'Could not scan wallet:' + err;
|
||||
$rootScope.$apply();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -390,14 +404,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
go.walletHome();
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/OnLine', function(event) {
|
||||
self.isOffLine = false;
|
||||
self.updateAll();
|
||||
self.updateTxHistory();
|
||||
lodash.each(['Local/Online', 'Local/Resume'], function(eventName) {
|
||||
$rootScope.$on(eventName, function(event) {
|
||||
$log.debug('### Online event');
|
||||
self.isOffline = false;
|
||||
self.clientError = null;
|
||||
self.updateAll();
|
||||
self.updateTxHistory();
|
||||
});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/OffLine', function(event) {
|
||||
self.isOffLine = true;
|
||||
$rootScope.$on('Local/Offline', function(event) {
|
||||
$log.debug('========== Offline event');
|
||||
self.isOffline = true;
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/BackupDone', function(event) {
|
||||
|
|
@ -415,13 +434,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
$rootScope.$apply();
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/BWSTimeOut', function(event) {
|
||||
self.clientError = 'Could not access to Bitcore Wallet Service: Timed out';
|
||||
$rootScope.$apply();
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/ClientError', function(event, err) {
|
||||
self.clientError = err;
|
||||
if (err.code && err.code === 'NOTAUTHORIZED') {
|
||||
// Show not error, just redirect to home (where the recreate option is shown)
|
||||
go.walletHome();
|
||||
} else if (err && err.cors == 'rejected') {
|
||||
$log.debug('CORS error:', err);
|
||||
} else if (err.code === 'ETIMEDOUT') {
|
||||
$log.debug('Time out:', err);
|
||||
} else {
|
||||
self.clientError = err;
|
||||
}
|
||||
$rootScope.$apply();
|
||||
});
|
||||
|
||||
|
|
@ -501,7 +524,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
$rootScope.$on('Local/NeedsPassword', function(event, isSetup, cb) {
|
||||
self.askPassword = {
|
||||
isSetup: isSetup,
|
||||
callback: function (err, pass) {
|
||||
callback: function(err, pass) {
|
||||
self.askPassword = null;
|
||||
return cb(err, pass);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,15 +16,17 @@ angular.module('copayApp.controllers').controller('receiveController',
|
|||
|
||||
this.newAddress = function() {
|
||||
self.generatingAddress = true;
|
||||
self.error = null;
|
||||
fc.createAddress(function(err, addr) {
|
||||
self.generatingAddress = false;
|
||||
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() {});
|
||||
}
|
||||
self.generatingAddress = false;
|
||||
$scope.$digest();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,13 +23,24 @@ angular.element(document).ready(function() {
|
|||
window.location = '#/';
|
||||
}
|
||||
}, false);
|
||||
|
||||
|
||||
document.addEventListener('resume', function() {
|
||||
window.location = '#/cordova/resume';
|
||||
setTimeout(function() {
|
||||
window.ignoreMobilePause = false;
|
||||
}, 100);
|
||||
}, false);
|
||||
|
||||
// We are not emitting here, since when the BWS socket reconnects,
|
||||
// update will be triggered
|
||||
document.addEventListener('offline', function() {
|
||||
window.location = '#/cordova/offline';
|
||||
}, false);
|
||||
//
|
||||
// document.addEventListener("online", function() {
|
||||
// window.location = '#/cordoba/online';
|
||||
// }, false);
|
||||
|
||||
document.addEventListener('backbutton', function() {
|
||||
window.location = '#/walletHome';
|
||||
}, false);
|
||||
|
|
@ -38,13 +49,7 @@ angular.element(document).ready(function() {
|
|||
window.location = '#/preferences';
|
||||
}, false);
|
||||
|
||||
document.addEventListener('offline', function() {
|
||||
window.location = '#/network/offline';
|
||||
}, false);
|
||||
|
||||
document.addEventListener("online", function() {
|
||||
window.location = '#/network/online';
|
||||
}, false);
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ if (window && window.navigator) {
|
|||
angular
|
||||
.module('copayApp')
|
||||
.config(function(bwcServiceProvider, $stateProvider, $urlRouterProvider) {
|
||||
bwcServiceProvider.setBaseUrl('http://192.168.1.102:3001/bws/api');
|
||||
$urlRouterProvider.otherwise('/');
|
||||
|
||||
$stateProvider
|
||||
|
|
@ -323,8 +322,8 @@ angular
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
.state('preferencesAltCurrency', {
|
||||
|
||||
.state('preferencesAltCurrency', {
|
||||
url: '/preferencesAltCurrency',
|
||||
templateUrl: 'views/preferencesAltCurrency.html',
|
||||
walletShouldBeComplete: true,
|
||||
|
|
@ -410,32 +409,35 @@ angular
|
|||
})
|
||||
|
||||
.state('add', {
|
||||
url: '/add',
|
||||
needProfile: true,
|
||||
views: {
|
||||
'main': {
|
||||
templateUrl: 'views/add.html'
|
||||
},
|
||||
'topbar': {
|
||||
templateUrl: 'views/includes/topbar.html',
|
||||
controller: function($scope) {
|
||||
$scope.titleSection = 'Add wallet';
|
||||
$scope.goBackToState = 'walletHome';
|
||||
url: '/add',
|
||||
needProfile: true,
|
||||
views: {
|
||||
'main': {
|
||||
templateUrl: 'views/add.html'
|
||||
},
|
||||
'topbar': {
|
||||
templateUrl: 'views/includes/topbar.html',
|
||||
controller: function($scope) {
|
||||
$scope.titleSection = 'Add wallet';
|
||||
$scope.goBackToState = 'walletHome';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('network', {
|
||||
url: '/network/:status',
|
||||
})
|
||||
.state('cordova', {
|
||||
url: '/cordova/:status',
|
||||
views: {
|
||||
'main': {
|
||||
controller: function($scope, $stateParams, go) {
|
||||
switch ($stateParams.status) {
|
||||
case 'online':
|
||||
$scope.$emit('Local/OnLine');
|
||||
case 'resume':
|
||||
$scope.$emit('Local/Resume');
|
||||
break;
|
||||
// case 'online':
|
||||
// // $scope.$emit('Local/Online');
|
||||
// break;
|
||||
case 'offline':
|
||||
$scope.$emit('Local/OffLine');
|
||||
$scope.$emit('Local/Offline');
|
||||
break;
|
||||
};
|
||||
go.walletHome();
|
||||
|
|
@ -492,8 +494,7 @@ angular
|
|||
|
||||
if (pageWeight[fromState.name] > pageWeight[toState.name]) {
|
||||
$rootScope.$emit('Animation/SwipeRight');
|
||||
}
|
||||
else if (pageWeight[fromState.name] < pageWeight[toState.name]) {
|
||||
} else if (pageWeight[fromState.name] < pageWeight[toState.name]) {
|
||||
$rootScope.$emit('Animation/SwipeLeft');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ angular.module('copayApp.services').factory('configService', function(localStora
|
|||
// Bitcore wallet service URL
|
||||
bws: {
|
||||
url: 'http://162.242.245.33:3004/bws/api',
|
||||
// url: 'http://localhost:3001/bws/api',
|
||||
},
|
||||
|
||||
// insight
|
||||
|
|
|
|||
|
|
@ -60,6 +60,20 @@ angular.module('copayApp.services')
|
|||
root.walletClients[credentials.walletId] = client;
|
||||
client.removeAllListeners();
|
||||
|
||||
|
||||
client.on('reconnect', function() {
|
||||
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
||||
$rootScope.$emit('Local/Online');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
client.on('reconnecting', function() {
|
||||
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
||||
$rootScope.$emit('Local/Offline');
|
||||
}
|
||||
});
|
||||
|
||||
client.on('notification', function(n) {
|
||||
$log.debug('BWC Notification:', n);
|
||||
notificationService.newBWCNotification(n,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue