commit
e4e388f7bd
14 changed files with 119 additions and 116 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
"url": "https://github.com/bitpay/copay/issues"
|
"url": "https://github.com/bitpay/copay/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore-wallet-client": "4.1.0",
|
"bitcore-wallet-client": "4.2.0",
|
||||||
"coveralls": "^2.11.9",
|
"coveralls": "^2.11.9",
|
||||||
"express": "^4.11.2",
|
"express": "^4.11.2",
|
||||||
"fs": "0.0.2",
|
"fs": "0.0.2",
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
"url": "https://github.com/bitpay/copay/issues"
|
"url": "https://github.com/bitpay/copay/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore-wallet-client": "4.1.0",
|
"bitcore-wallet-client": "4.2.0",
|
||||||
"coveralls": "^2.11.9",
|
"coveralls": "^2.11.9",
|
||||||
"express": "^4.11.2",
|
"express": "^4.11.2",
|
||||||
"fs": "0.0.2",
|
"fs": "0.0.2",
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="item button button-block button-balanced" ng-click="approve()" ng-disabled="!txp">
|
<button class="item button button-block button-balanced" ng-click="approve()">
|
||||||
<span translate>Send</span>
|
<span translate>Send</span>
|
||||||
</button>
|
</button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,31 @@
|
||||||
<i class="icon ion-ios-circle-filled" ng-show="tx.pendingForUs" ng-style="{'color':tx.wallet.color}"></i>
|
|
||||||
<span ng-show="!tx.merchant">
|
|
||||||
<span ng-show="addressbook[tx.toAddress] && !tx.message">
|
|
||||||
{{addressbook[tx.toAddress]}}
|
|
||||||
</span>
|
|
||||||
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
|
|
||||||
{{tx.message}}
|
|
||||||
</span>
|
|
||||||
<span ng-show="!addressbook[tx.toAddress] && !tx.message" translate>
|
|
||||||
Sending
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span ng-show="tx.merchant">
|
|
||||||
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
|
|
||||||
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
- {{tx.amountStr}}
|
|
||||||
</span>
|
|
||||||
<div class="item-note">
|
|
||||||
{{tx.wallet.name}} · <time>{{ (tx.ts || tx.createdOn ) * 1000 | amTimeAgo}}</time>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="wallet-activity" ng-class="{'wallet-activity-not-pending':!tx.pendingForUs}">
|
||||||
|
<span ng-show="!tx.merchant">
|
||||||
|
<span ng-show="addressbook[tx.toAddress] && !tx.message">
|
||||||
|
{{addressbook[tx.toAddress]}}
|
||||||
|
</span>
|
||||||
|
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
|
||||||
|
{{tx.message}}
|
||||||
|
</span>
|
||||||
|
<span ng-show="!addressbook[tx.toAddress] && !tx.message" translate>
|
||||||
|
Sending
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span ng-show="tx.merchant">
|
||||||
|
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
|
||||||
|
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="wallet-activity-amount">
|
||||||
|
{{tx.amountStr}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<p class="wallet-activity-note">
|
||||||
|
<i class="icon ion-record wallet-activity-note-child" ng-style="{'color':tx.wallet.color}"></i>
|
||||||
|
<span class="wallet-activity-note-child">{{tx.wallet.name}}</span>
|
||||||
|
<time class="wallet-activity-note-child">{{tx.createdOn * 1000 | amTimeAgo}}</time>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
<i class="icon ion-ios-film-outline"></i>
|
<i class="icon ion-ios-film-outline"></i>
|
||||||
<span translate>Version</span>
|
<span translate>Version</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
v{{v.version}}
|
v{{version}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item item-icon-left" ng-click="$root.openExternalLink('https://github.com/bitpay/copay/tree/'+v.commitHash)">
|
<div class="item item-icon-left" ng-click="$root.openExternalLink('https://github.com/bitpay/copay/tree/'+commitHash)">
|
||||||
<i class="icon ion-ios-film-outline"></i>
|
<i class="icon ion-ios-film-outline"></i>
|
||||||
<span translate>Commit hash</span>
|
<span translate>Commit hash</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
#{{v.commitHash}}
|
#{{commitHash}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item item-divider">
|
<div class="item item-divider">
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<ion-content class="padding" ng-controller="proposalsController" ng-init="init()">
|
<ion-content class="padding" ng-controller="proposalsController" ng-init="init()">
|
||||||
|
|
||||||
<div class="list card">
|
<div class="list card">
|
||||||
<a ng-repeat="tx in txps" class="item item-icon-left" ng-click="openTxpModal(tx)">
|
<a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)">
|
||||||
<span ng-include="'views/includes/txp.html'"></span>
|
<span ng-include="'views/includes/txp.html'"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<span class="badge badge-assertive" ng-show="txpsN>3" translate> {{txpsN}}</span>
|
<span class="badge badge-assertive" ng-show="txpsN>3" translate> {{txpsN}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a ng-repeat="tx in txps" class="item item-icon-left" ng-click="openTxpModal(tx)">
|
<a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)">
|
||||||
<span ng-include="'views/includes/txp.html'"></span>
|
<span ng-include="'views/includes/txp.html'"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<ion-spinner icon="lines"></ion-spinner>
|
<ion-spinner icon="lines"></ion-spinner>
|
||||||
<div translate>Updating activity. Please stand by</div>
|
<div translate>Updating activity. Please stand by</div>
|
||||||
</span>
|
</span>
|
||||||
<a ng-if="!fetchingNotifications" class="item" ng-repeat="x in notifications" ng-click="x.action()">
|
<a ng-if="notifications[0]" class="item" ng-repeat="x in notifications" ng-click="x.action()">
|
||||||
<span ng-include="'views/includes/walletActivity.html'"></span>
|
<span ng-include="'views/includes/walletActivity.html'"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -118,5 +118,9 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p class="padding" style="text-align:center; color:#999">
|
||||||
|
{{name}} v{{version}}
|
||||||
|
</p>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,17 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
var cachedTxp = {};
|
var cachedTxp = {};
|
||||||
var isChromeApp = platformInfo.isChromeApp;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.$on('Wallet/Changed', function(event, wallet) {
|
||||||
|
if (lodash.isEmpty(wallet)) {
|
||||||
|
$log.debug('No wallet provided');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$log.debug('Wallet changed: ' + wallet.name);
|
||||||
|
setWallet(wallet, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.showDescriptionPopup = function() {
|
$scope.showDescriptionPopup = function() {
|
||||||
var commentPopup = $ionicPopup.show({
|
var commentPopup = $ionicPopup.show({
|
||||||
templateUrl: "views/includes/note.html",
|
templateUrl: "views/includes/note.html",
|
||||||
|
|
@ -17,13 +28,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
$scope.commentPopupSave = function(description) {
|
$scope.commentPopupSave = function(description) {
|
||||||
$log.debug('Saving description: ' + description);
|
$log.debug('Saving description: ' + description);
|
||||||
$scope.description = description;
|
$scope.description = description;
|
||||||
$scope.txp = null;
|
|
||||||
|
|
||||||
createTx($scope.wallet, function(err, txp) {
|
|
||||||
if (err) return;
|
|
||||||
cachedTxp[$scope.wallet.id] = txp;
|
|
||||||
apply(txp);
|
|
||||||
});
|
|
||||||
commentPopup.close();
|
commentPopup.close();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -137,15 +141,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on('Wallet/Changed', function(event, wallet) {
|
|
||||||
if (lodash.isEmpty(wallet)) {
|
|
||||||
$log.debug('No wallet provided');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$log.debug('Wallet changed: ' + wallet.name);
|
|
||||||
setWallet(wallet, true);
|
|
||||||
});
|
|
||||||
|
|
||||||
function setWallet(wallet, delayed) {
|
function setWallet(wallet, delayed) {
|
||||||
var stop;
|
var stop;
|
||||||
$scope.wallet = wallet;
|
$scope.wallet = wallet;
|
||||||
|
|
@ -165,7 +160,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
apply(cachedTxp[wallet.id]);
|
apply(cachedTxp[wallet.id]);
|
||||||
} else {
|
} else {
|
||||||
stop = $timeout(function() {
|
stop = $timeout(function() {
|
||||||
createTx(wallet, function(err, txp) {
|
createTx(wallet, true, function(err, txp) {
|
||||||
if (err) return;
|
if (err) return;
|
||||||
cachedTxp[wallet.id] = txp;
|
cachedTxp[wallet.id] = txp;
|
||||||
apply(txp);
|
apply(txp);
|
||||||
|
|
@ -184,7 +179,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
};
|
};
|
||||||
|
|
||||||
var createTx = function(wallet, cb) {
|
var createTx = function(wallet, dryRun, cb) {
|
||||||
var config = configService.getSync().wallet;
|
var config = configService.getSync().wallet;
|
||||||
var currentSpendUnconfirmed = config.spendUnconfirmed;
|
var currentSpendUnconfirmed = config.spendUnconfirmed;
|
||||||
var outputs = [];
|
var outputs = [];
|
||||||
|
|
@ -227,6 +222,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
txp.payProUrl = paypro;
|
txp.payProUrl = paypro;
|
||||||
txp.excludeUnconfirmedUtxos = config.spendUnconfirmed ? false : true;
|
txp.excludeUnconfirmedUtxos = config.spendUnconfirmed ? false : true;
|
||||||
txp.feeLevel = config.settings.feeLevel || 'normal';
|
txp.feeLevel = config.settings.feeLevel || 'normal';
|
||||||
|
txp.dryRun = dryRun;
|
||||||
|
|
||||||
walletService.createTx(wallet, txp, function(err, ctxp) {
|
walletService.createTx(wallet, txp, function(err, ctxp) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -247,14 +243,10 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
|
|
||||||
$scope.approve = function() {
|
$scope.approve = function() {
|
||||||
var wallet = $scope.wallet;
|
var wallet = $scope.wallet;
|
||||||
var txp = $scope.txp;
|
|
||||||
if (!wallet) {
|
if (!wallet) {
|
||||||
return setSendError(gettextCatalog.getString('No wallet selected'));
|
return setSendError(gettextCatalog.getString('No wallet selected'));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!txp) {
|
|
||||||
return setSendError(gettextCatalog.getString('No transaction'));
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
|
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
|
||||||
$log.info('No signing proposal: No private key');
|
$log.info('No signing proposal: No private key');
|
||||||
|
|
@ -265,9 +257,14 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
ongoingProcess.set('creatingTx', true);
|
||||||
if (err) return setSendError(err);
|
createTx(wallet, false, function(err, txp) {
|
||||||
$state.transitionTo('tabs.home');
|
ongoingProcess.set('creatingTx', false);
|
||||||
|
if (err) return;
|
||||||
|
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
||||||
|
if (err) return setSendError(err);
|
||||||
|
$state.transitionTo('tabs.home');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,9 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
|
||||||
$scope.sign = function() {
|
$scope.sign = function() {
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
walletService.publishAndSign($scope.wallet, $scope.tx, function(err, txp) {
|
walletService.publishAndSign($scope.wallet, $scope.tx, function(err, txp) {
|
||||||
|
|
||||||
console.log('[txpDetails.js.35] AFTER publush'); //TODO
|
|
||||||
|
|
||||||
$scope.$emit('UpdateTx');
|
$scope.$emit('UpdateTx');
|
||||||
if (err) return setSendError(err);
|
if (err) return setSendError(err);
|
||||||
$scope.close(txp);
|
$scope.close();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -53,7 +50,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
|
||||||
if (err)
|
if (err)
|
||||||
return setError(err, gettextCatalog.getString('Could not reject payment'));
|
return setError(err, gettextCatalog.getString('Could not reject payment'));
|
||||||
|
|
||||||
$scope.close(txpr);
|
$scope.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -90,7 +87,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
|
||||||
return setError(err, gettextCatalog.getString('Could not broadcast payment'));
|
return setError(err, gettextCatalog.getString('Could not broadcast payment'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.close(txpb);
|
$scope.close();
|
||||||
});
|
});
|
||||||
}, 10);
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
@ -175,7 +172,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.close = function(txp) {
|
$scope.close = function() {
|
||||||
$scope.loading = null;
|
$scope.loading = null;
|
||||||
$scope.txpDetailsModal.hide();
|
$scope.txpDetailsModal.hide();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesAbout',
|
angular.module('copayApp.controllers').controller('preferencesAbout',
|
||||||
function($ionicNavBarDelegate, gettextCatalog) {
|
function($scope, $window, $ionicNavBarDelegate, gettextCatalog) {
|
||||||
$ionicNavBarDelegate.title(gettextCatalog.getString('About Copay'));
|
$ionicNavBarDelegate.title(gettextCatalog.getString('About Copay'));
|
||||||
|
|
||||||
|
$scope.version = $window.version;
|
||||||
|
$scope.commitHash = $window.commitHash;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,30 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService, txpModalService) {
|
function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService, txpModalService, $window) {
|
||||||
|
|
||||||
$scope.externalServices = {};
|
$scope.externalServices = {};
|
||||||
$scope.bitpayCardEnabled = true; // TODO
|
$scope.bitpayCardEnabled = true; // TODO
|
||||||
|
|
||||||
|
|
||||||
|
function updateTxps() {
|
||||||
|
profileService.getTxps({
|
||||||
|
limit: 3
|
||||||
|
}, function(err, txps, n) {
|
||||||
|
if (err) {
|
||||||
|
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||||
|
}
|
||||||
|
$scope.txps = txps;
|
||||||
|
$scope.txpsN = n;
|
||||||
|
$ionicScrollDelegate.resize();
|
||||||
|
|
||||||
var setPendingTxps = function(txps) {
|
$timeout(function() {
|
||||||
if (!txps) {
|
$scope.$apply();
|
||||||
$scope.txps = [];
|
}, 1);
|
||||||
return;
|
})
|
||||||
}
|
|
||||||
$scope.txps = lodash.sortBy(txps, 'createdOn').reverse();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.updateAllWallets = function() {
|
$scope.updateAllWallets = function() {
|
||||||
$scope.wallets = profileService.getWallets();
|
$scope.wallets = profileService.getWallets();
|
||||||
if (lodash.isEmpty($scope.wallets)) return;
|
if (lodash.isEmpty($scope.wallets)) return;
|
||||||
|
|
@ -35,20 +42,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
wallet.status = status;
|
wallet.status = status;
|
||||||
}
|
}
|
||||||
if (++j==i) {
|
if (++j==i) {
|
||||||
profileService.getTxps({
|
updateTxps();
|
||||||
limit: 3
|
|
||||||
}, function(err, txps, n) {
|
|
||||||
if (err) {
|
|
||||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
|
||||||
}
|
|
||||||
$scope.txps = txps;
|
|
||||||
$scope.txpsN = n;
|
|
||||||
$ionicScrollDelegate.resize();
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
}, 1);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -81,29 +75,18 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
}
|
}
|
||||||
wallet.status = status;
|
wallet.status = status;
|
||||||
|
|
||||||
|
$scope.fetchingNotifications = true;
|
||||||
profileService.getNotifications({
|
profileService.getNotifications({
|
||||||
limit: 3
|
limit: 3
|
||||||
}, function(err, notifications) {
|
}, function(err, notifications) {
|
||||||
|
$scope.fetchingNotifications = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.notifications = notifications;
|
$scope.notifications = notifications;
|
||||||
|
|
||||||
profileService.getTxps({
|
updateTxps();
|
||||||
limit: 3
|
|
||||||
}, function(err, txps, n) {
|
|
||||||
if (err) {
|
|
||||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
|
||||||
}
|
|
||||||
$scope.txps = txps;
|
|
||||||
$scope.txpsN = n;
|
|
||||||
$ionicScrollDelegate.resize();
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
}, 1);
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -123,6 +106,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
$scope.updateWallet(wallet);
|
$scope.updateWallet(wallet);
|
||||||
}),
|
}),
|
||||||
$rootScope.$on('Local/TxAction', function(e, walletId) {
|
$rootScope.$on('Local/TxAction', function(e, walletId) {
|
||||||
|
$log.debug('Got action for wallet '+ walletId);
|
||||||
var wallet = profileService.getWallet(walletId);
|
var wallet = profileService.getWallet(walletId);
|
||||||
$scope.updateWallet(wallet);
|
$scope.updateWallet(wallet);
|
||||||
}),
|
}),
|
||||||
|
|
@ -143,5 +127,9 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
|
|
||||||
$scope.openTxpModal = txpModalService.open;
|
$scope.openTxpModal = txpModalService.open;
|
||||||
|
|
||||||
|
$scope.version = $window.version;
|
||||||
|
$scope.name = $window.appConfig.nameCase;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,6 @@ angular.module('copayApp.services')
|
||||||
if (wallet.cachedActivity)
|
if (wallet.cachedActivity)
|
||||||
wallet.cachedActivity.isValid = false;
|
wallet.cachedActivity.isValid = false;
|
||||||
|
|
||||||
|
|
||||||
if (wallet.cachedTxps)
|
if (wallet.cachedTxps)
|
||||||
wallet.cachedTxps.isValid = false;
|
wallet.cachedTxps.isValid = false;
|
||||||
|
|
||||||
|
|
@ -908,22 +907,14 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
var txps = [];
|
var txps = [];
|
||||||
|
|
||||||
function process(notifications) {
|
|
||||||
if (!notifications) return [];
|
|
||||||
|
|
||||||
var shown = lodash.sortBy(notifications, 'createdOn').reverse();
|
|
||||||
shown = shown.splice(0, opts.limit || MAX);
|
|
||||||
return shown;
|
|
||||||
};
|
|
||||||
|
|
||||||
lodash.each(w, function(x) {
|
lodash.each(w, function(x) {
|
||||||
if (x.pendingTxps)
|
if (x.pendingTxps)
|
||||||
txps = txps.concat(x.pendingTxps);
|
txps = txps.concat(x.pendingTxps);
|
||||||
});
|
});
|
||||||
txps = lodash.sortBy(txps, 'createdOn');
|
txps = lodash.sortBy(txps, 'pendingForUs', 'createdOn');
|
||||||
txps = lodash.compact(lodash.flatten(txps)).slice(0,MAX);
|
txps = lodash.compact(lodash.flatten(txps)).slice(0,MAX);
|
||||||
var n = txps.length;
|
var n = txps.length;
|
||||||
return cb(null, process(txps), n);
|
return cb(null, txps, n);
|
||||||
};
|
};
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
|
||||||
|
|
@ -92,13 +92,17 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
|
|
||||||
|
|
||||||
root.invalidateCache = function(wallet) {
|
root.invalidateCache = function(wallet) {
|
||||||
if (wallet.cachedStatus) {
|
if (wallet.cachedStatus)
|
||||||
wallet.cachedStatus.isValid = false;
|
wallet.cachedStatus.isValid = false;
|
||||||
}
|
|
||||||
|
|
||||||
if (wallet.completeHistory) {
|
if (wallet.completeHistory)
|
||||||
wallet.completeHistory.isValid = false;
|
wallet.completeHistory.isValid = false;
|
||||||
}
|
|
||||||
|
if (wallet.cachedActivity)
|
||||||
|
wallet.cachedActivity.isValid = false;
|
||||||
|
|
||||||
|
if (wallet.cachedTxps)
|
||||||
|
wallet.cachedTxps.isValid = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getStatus = function(wallet, opts, cb) {
|
root.getStatus = function(wallet, opts, cb) {
|
||||||
|
|
@ -623,6 +627,10 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
|
|
||||||
wallet.removeTxProposal(txp, function(err) {
|
wallet.removeTxProposal(txp, function(err) {
|
||||||
$log.debug('Transaction removed');
|
$log.debug('Transaction removed');
|
||||||
|
|
||||||
|
root.invalidateCache(wallet);
|
||||||
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
|
|
||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -852,6 +860,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
|
|
||||||
askPassword(wallet.name, gettext('Enter Spending Password'), function(password) {
|
askPassword(wallet.name, gettext('Enter Spending Password'), function(password) {
|
||||||
if (!password) return cb('no password');
|
if (!password) return cb('no password');
|
||||||
|
if (!wallet.checkPassword(password)) return cb('wrong password');
|
||||||
|
|
||||||
|
|
||||||
return cb(null, password);
|
return cb(null, password);
|
||||||
});
|
});
|
||||||
|
|
@ -862,8 +872,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
ongoingProcess.set('rejectTx', true);
|
ongoingProcess.set('rejectTx', true);
|
||||||
root.rejectTx(wallet, txp, function(err, txpr) {
|
root.rejectTx(wallet, txp, function(err, txpr) {
|
||||||
root.invalidateCache(wallet);
|
root.invalidateCache(wallet);
|
||||||
|
|
||||||
ongoingProcess.set('rejectTx', false);
|
ongoingProcess.set('rejectTx', false);
|
||||||
|
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
|
|
@ -933,6 +943,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
var msg = err.message ?
|
var msg = err.message ?
|
||||||
err.message :
|
err.message :
|
||||||
gettext('The payment was created but could not be completed. Please try again from home screen');
|
gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
|
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
return cb(msg);
|
return cb(msg);
|
||||||
}
|
}
|
||||||
|
|
@ -943,18 +954,18 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
ongoingProcess.set('broadcastingTx', false);
|
ongoingProcess.set('broadcastingTx', false);
|
||||||
if (err) return cb('sign error' + err);
|
if (err) return cb('sign error' + err);
|
||||||
|
|
||||||
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
var type = root.getViewStatus(wallet, broadcastedTxp);
|
var type = root.getViewStatus(wallet, broadcastedTxp);
|
||||||
root.openStatusModal(type, broadcastedTxp, function() {
|
root.openStatusModal(type, broadcastedTxp, function() {
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return cb(null, broadcastedTxp)
|
return cb(null, broadcastedTxp)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
|
|
||||||
var type = root.getViewStatus(wallet, signedTxp);
|
var type = root.getViewStatus(wallet, signedTxp);
|
||||||
root.openStatusModal(type, signedTxp, function() {
|
root.openStatusModal(type, signedTxp, function() {
|
||||||
root.invalidateCache(wallet);
|
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
|
||||||
});
|
});
|
||||||
return cb(null, signedTxp);
|
return cb(null, signedTxp);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
.wallet-activity {
|
.wallet-activity {
|
||||||
|
|
||||||
|
&-not-pending {
|
||||||
|
background-color:#eee;
|
||||||
|
}
|
||||||
|
|
||||||
&-amount {
|
&-amount {
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue