Fix modals and choose focused wallet in sell page
This commit is contained in:
parent
25721a3387
commit
3e8a3976eb
4 changed files with 68 additions and 6 deletions
|
|
@ -22,6 +22,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
|||
self.selectedWalletName = null;
|
||||
self.selectedWalletAddr = null;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.type = 'BUY';
|
||||
$scope.wallets = wallets;
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
|
|
@ -49,7 +50,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
|||
};
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/wallets.html',
|
||||
templateUrl: 'views/modals/glidera-wallets.html',
|
||||
windowClass: animationService.modalAnimated.slideUp,
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,18 +14,39 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
|||
this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal';
|
||||
var fc;
|
||||
|
||||
this.otherWallets = function(testnet) {
|
||||
var otherWallets = function(testnet) {
|
||||
var network = testnet ? 'testnet' : 'livenet';
|
||||
return lodash.filter(profileService.getWallets(network), function(w) {
|
||||
return w.network == network && w.m == 1;
|
||||
});
|
||||
};
|
||||
|
||||
this.init = function(testnet) {
|
||||
self.otherWallets = otherWallets(testnet);
|
||||
// Choose focused wallet
|
||||
try {
|
||||
var currentWalletId = profileService.focusedClient.credentials.walletId;
|
||||
lodash.find(self.otherWallets, function(w) {
|
||||
if (w.id == currentWalletId) {
|
||||
$timeout(function() {
|
||||
self.selectedWalletId = w.id;
|
||||
self.selectedWalletName = w.name;
|
||||
fc = profileService.getClient(w.id);
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
$log.debug(e);
|
||||
};
|
||||
};
|
||||
|
||||
$scope.openWalletsModal = function(wallets) {
|
||||
self.error = null;
|
||||
self.selectedWalletId = null;
|
||||
self.selectedWalletName = null;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.type = 'SELL';
|
||||
$scope.wallets = wallets;
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
|
|
@ -45,7 +66,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
|||
};
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/wallets.html',
|
||||
templateUrl: 'views/modals/glidera-wallets.html',
|
||||
windowClass: animationService.modalAnimated.slideUp,
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue