Merge pull request #145 from JDonadio/feat/open-tx-modal

Open tx/txp modal without navigation
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-21 12:10:03 -03:00 committed by GitHub
commit e5b237bb7a
11 changed files with 226 additions and 84 deletions

View file

@ -32,6 +32,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'sweepingWallet': gettext('Sweeping Wallet...'),
'validatingWallet': gettext('Validating wallet integrity...'),
'validatingWords': gettext('Validating recovery phrase...'),
'loadingTxInfo': gettext('Loading transaction info...'),
};
root.clear = function() {

View file

@ -822,11 +822,11 @@ angular.module('copayApp.services')
x.action = function() {
// TODO?
$state.go('tabs.details', {
walletId: x.walletId,
txpId: x.txpId,
txid: x.txid,
});
// $state.go('tabs.details', {
// walletId: x.walletId,
// txpId: x.txpId,
// txid: x.txid,
// });
};
});

View file

@ -502,6 +502,32 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
});
};
root.getTx = function(wallet, txid, cb) {
var tx;
if (wallet.completeHistory && wallet.completeHistory.isValid) {
tx = lodash.find(wallet.completeHistory, {
txid: txid
});
finish();
} else {
root.getTxHistory(wallet, {}, function(err, txHistory) {
if (err) return cb(err);
tx = lodash.find(txHistory, {
txid: txid
});
finish();
});
}
function finish() {
if (tx) return cb(null, tx);
else return cb();
};
};
root.getTxHistory = function(wallet, opts, cb) {
opts = opts || {};