fix merge conflicts

This commit is contained in:
Marty Alcala 2016-10-27 11:44:03 -04:00
commit d4513ba46b
53 changed files with 263 additions and 204 deletions

View file

@ -39,7 +39,7 @@ angular.module('copayApp.controllers').controller('activityController',
ongoingProcess.set('loadingTxInfo', false);
if (err) {
$log.warn('No txp found');
return popupService.showAlert(null, gettextCatalog.getString('Transaction not found'));
return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found'));
}
txpModalService.open(_txp);
});
@ -61,7 +61,7 @@ angular.module('copayApp.controllers').controller('activityController',
if (!tx) {
$log.warn('No tx found');
return popupService.showAlert(null, gettextCatalog.getString('Transaction not found'));
return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found'));
}
$scope.wallet = wallet;

View file

@ -47,7 +47,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
$timeout(function() {
addressbookService.remove(addr, function(err, ab) {
if (err) {
popupService.showAlert(err);
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
initAddressbook();
@ -56,7 +56,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
}, 100);
};
$scope.$on("$ionicView.beforeEnter", function(event, data){
$scope.$on("$ionicView.beforeEnter", function(event, data) {
initAddressbook();
});

View file

@ -27,7 +27,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
$timeout(function() {
addressbookService.add(addressbook, function(err, ab) {
if (err) {
popupService.showAlert(err);
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
if ($scope.fromSendTab) $scope.goHome();

View file

@ -12,7 +12,7 @@ angular.module('copayApp.controllers').controller('amazonController',
var initAmazon = function() {
amazonService.getPendingGiftCards(function(err, gcds) {
if (err) {
popupService.showAlert(err);
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
$scope.giftCards = lodash.isEmpty(gcds) ? null : gcds;
@ -31,7 +31,7 @@ angular.module('copayApp.controllers').controller('amazonController',
$log.debug("creating gift card");
amazonService.createGiftCard(dataFromStorage, function(err, giftCard) {
if (err) {
popupService.showAlert(bwcError.msg(err));
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
return;
}
if (giftCard.status != 'PENDING') {
@ -51,7 +51,7 @@ angular.module('copayApp.controllers').controller('amazonController',
$log.debug("Saving new gift card");
amazonService.getPendingGiftCards(function(err, gcds) {
if (err) {
popupService.showAlert(err);
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
$scope.giftCards = gcds;

View file

@ -131,7 +131,6 @@ angular.module('copayApp.controllers').controller('backupController',
}
profileService.setBackupFlag(wallet.credentials.walletId);
profileService.setBackupNeededModalFlag(wallet.credentials.walletId);
return cb();
}, 1);
};

View file

@ -4,12 +4,14 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
var self = this;
var runningBalance;
$scope.dateRange = { value: 'last30Days'};
$scope.dateRange = {
value: 'last30Days'
};
$scope.network = bitpayCardService.getEnvironment();
var updateHistoryFromCache = function(cb) {
bitpayCardService.getBitpayDebitCardsHistory($scope.cardId, function(err, data) {
if (err || lodash.isEmpty(data)) return cb();
if (err ||  lodash.isEmpty(data)) return cb();
$scope.historyCached = true;
self.bitpayCardTransactionHistory = data.transactions;
self.bitpayCardCurrentBalance = data.balance;
@ -19,8 +21,8 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
var setDateRange = function(preset) {
var startDate, endDate;
preset = preset || 'last30Days';
switch(preset) {
preset = preset ||  'last30Days';
switch (preset) {
case 'last30Days':
startDate = moment().subtract(30, 'days').toISOString();
endDate = moment().toISOString();
@ -138,7 +140,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
disableAnimate: true
});
$state.go('tabs.home');
popupService.showAlert(null, msg);
popupService.showAlert(gettextCatalog.getString('Error'), msg);
} else {
updateHistoryFromCache(function() {
self.update();
@ -147,4 +149,3 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
});
});

View file

@ -24,11 +24,13 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
obj.otp = otp;
bitpayCardService.bitAuthPair(obj, function(err, data) {
if (err) {
popupService.showAlert(null, err);
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
var title = gettextCatalog.getString('Add BitPay Card Account?');
var msg = gettextCatalog.getString('Would you like to add this account ({{email}}) to your wallet?', {email: obj.email});
var msg = gettextCatalog.getString('Would you like to add this account ({{email}}) to your wallet?', {
email: obj.email
});
var ok = gettextCatalog.getString('Add Account');
var cancel = gettextCatalog.getString('Go back');
popupService.showConfirm(title, msg, ok, cancel, function(res) {
@ -43,7 +45,9 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
});
$state.go('tabs.home').then(function() {
if (data.cards[0]) {
$state.transitionTo('tabs.bitpayCard', {id: data.cards[0].id});
$state.transitionTo('tabs.bitpayCard', {
id: data.cards[0].id
});
}
});
});

View file

@ -84,6 +84,9 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.insuffientFunds = true;
$log.warn('No wallet available to make the payment');
$timeout(function() {
$scope.$apply();
});
}
}
});
@ -99,7 +102,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$timeout(function() {
$scope.$apply();
}, 100);
});
};
$scope.$on('accepted', function(event) {
@ -286,6 +289,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
};
$scope.approve = function(onSendStatusChange) {
if ($scope.paypro && $scope.paymentExpired.value) {
popupService.showAlert(null, gettextCatalog.getString('The payment request has expired'));
$scope.sendStatus = '';

View file

@ -60,7 +60,7 @@ angular.module('copayApp.controllers').controller('importController',
};
if (info.type == 1 && info.hasPassphrase)
popupService.showAlert(gettextCatalog.getString('Password required. Make sure to enter your password in advanced options'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Password required. Make sure to enter your password in advanced options'));
$scope.formData.derivationPath = info.derivationPath;
$scope.formData.testnetEnabled = info.network == 'testnet' ? true : false;
@ -236,7 +236,7 @@ angular.module('copayApp.controllers').controller('importController',
var words = $scope.formData.words || null;
if (!words) {
popupService.showAlert(gettextCatalog.getString('Please enter the recovery phrase'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Please enter the recovery phrase'));
} else if (words.indexOf('xprv') == 0 || words.indexOf('tprv') == 0) {
return _importExtendedPrivateKey(words, opts);
} else if (words.indexOf('xpub') == 0 || words.indexOf('tpuv') == 0) {
@ -245,7 +245,7 @@ angular.module('copayApp.controllers').controller('importController',
var wordList = words.split(/[\u3000\s]+/);
if ((wordList.length % 3) != 0) {
popupService.showAlert(gettextCatalog.getString('Wrong number of recovery words:') + wordList.length);
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Wrong number of recovery words: ') + wordList.length);
return;
}
}
@ -280,7 +280,7 @@ angular.module('copayApp.controllers').controller('importController',
$scope.importHW = function(form) {
if (form.$invalid || $scope.formData.ccount < 0) {
popupService.showAlert(gettextCatalog.getString('There is an error in the form'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('There is an error in the form'));
return;
}
@ -290,7 +290,7 @@ angular.module('copayApp.controllers').controller('importController',
if ($scope.seedSource.id == 'trezor') {
if (account < 1) {
popupService.showAlert(gettextCatalog.getString('Invalid account number'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid account number'));
return;
}
account = account - 1;

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService, addressbookService) {
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService, addressbookService) {
var wallet;
var listeners = [];
var notifications = [];
@ -12,6 +12,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.homeTip = $stateParams.fromOnboarding;
$scope.isCordova = platformInfo.isCordova;
$scope.isAndroid = platformInfo.isAndroid;
$scope.isNW = platformInfo.isNW;
$scope.$on("$ionicView.afterEnter", function() {
startupService.ready();
@ -23,6 +24,21 @@ angular.module('copayApp.controllers').controller('tabHomeController',
});
}
if ($scope.isNW) {
latestReleaseService.checkLatestRelease(function(err, newRelease) {
if (err) {
$log.warn(err);
return;
}
if (newRelease) $scope.newRelease = true;
});
}
$scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) {
externalLinkService.open(url, optIn, title, message, okText, cancelText);
};
$scope.openNotificationModal = function(n) {
wallet = profileService.getWallet(n.walletId);
@ -41,7 +57,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
ongoingProcess.set('loadingTxInfo', false);
if (err) {
$log.warn('No txp found');
return popupService.showAlert(null, gettextCatalog.getString('Transaction not found'));
return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found'));
}
txpModalService.open(_txp);
});
@ -63,7 +79,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
if (!tx) {
$log.warn('No tx found');
return popupService.showAlert(null, gettextCatalog.getString('Transaction not found'));
return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found'));
}
$scope.wallet = wallet;
@ -181,13 +197,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
});
};
var nextStep = function() {
lodash.each(['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'], function(service) {
var nextStep = function(cb) {
var i = 0;
var services = ['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'];
lodash.each(services, function(service) {
storageService.getNextStep(service, function(err, value) {
$scope.externalServices[service] = value ? true : false;
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
if (++i == services.length) return cb();
});
});
};
@ -227,7 +243,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
};
$scope.$on("$ionicView.enter", function(event, data) {
nextStep();
updateAllWallets();
addressbookService.list(function(err, ab) {
@ -248,22 +263,28 @@ angular.module('copayApp.controllers').controller('tabHomeController',
];
configService.whenAvailable(function() {
var config = configService.getSync();
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
nextStep(function() {
var config = configService.getSync();
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
$scope.amazonEnabled = config.amazon.enabled;
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
$scope.amazonEnabled = config.amazon.enabled;
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled);
var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled;
var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled;
var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled);
var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled;
var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled;
$scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled;
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
$scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled;
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
if ($scope.bitpayCardEnabled) bitpayCardCache();
if ($scope.bitpayCardEnabled) bitpayCardCache();
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
});
});
});

View file

@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
var showModalTimeout;
$scope.shareAddress = function(addr) {
if ($scope.generatingAddress) return;
@ -21,11 +20,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) {
showModalTimeout = $timeout(function() {
$scope.openBackupNeededModal();
}, 2000);
}
$timeout(function() {
$scope.$apply();
}, 10);
@ -59,7 +53,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.close = function() {
$scope.BackupNeededModal.hide();
$scope.BackupNeededModal.remove();
profileService.setBackupNeededModalFlag($scope.wallet.credentials.walletId);
};
$scope.doBackup = function() {
@ -84,16 +77,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
return;
}
$scope.wallet = wallet;
$scope.generatingAddress = false;
$log.debug('Wallet changed: ' + wallet.name);
$timeout(function() {
$scope.setAddress();
$scope.setAddress(false);
}, 100);
});
$scope.$on("$ionicView.leave", function(event, data) {
$timeout.cancel(showModalTimeout);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets();
});

View file

@ -149,6 +149,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
}
});
});
if ($scope.hasFunds != true) {
$ionicScrollDelegate.freezeScroll(true);
}
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {

View file

@ -4,7 +4,7 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
$scope.onScan = function(data) {
if (!incomingData.redir(data)) {
popupService.showAlert(null, gettextCatalog.getString('Invalid data'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid data'));
}
};
@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
}, 1);
};
$scope.$on("$ionicView.beforeEnter", function(event, data){
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$rootScope.hideTabs = '';
});

View file

@ -23,7 +23,7 @@ angular.module('copayApp.services')
if (latest.major < current.major || (latest.major == current.major && latest.minor <= current.minor))
return cb(null, false);
$log.debug('A new version of Copay is available: ' + latestVersion);
$log.debug('A new version is available: ' + latestVersion);
return cb(null, true);
});

View file

@ -38,22 +38,6 @@ angular.module('copayApp.services')
});
}
root.setBackupNeededModalFlag = function(walletId) {
storageService.setBackupNeededModalFlag(walletId, true, function(err) {
if (err) $log.error(err);
$log.debug('Backup warning modal flag stored');
root.wallet[walletId].showBackupNeededModal = false;
});
};
function _showBackupNeededModal(wallet, cb) {
storageService.getBackupNeededModalFlag(wallet.credentials.walletId, function(err, val) {
if (err) $log.error(err);
if (val) return cb(false);
return cb(true);
});
};
root.setBackupFlag = function(walletId) {
storageService.setBackupFlag(walletId, function(err) {
if (err) $log.error(err);
@ -117,11 +101,6 @@ angular.module('copayApp.services')
wallet.balanceHidden = val;
});
_showBackupNeededModal(wallet, function(val) {
if (wallet.needsBackup) wallet.showBackupNeededModal = val;
else wallet.showBackupNeededModal = false;
});
wallet.removeAllListeners();
wallet.on('report', function(n) {

View file

@ -373,15 +373,6 @@ angular.module('copayApp.services')
});
};
root.setBackupNeededModalFlag = function(walletId, val, cb) {
storage.set('showBackupNeededModal-' + walletId, val, cb);
};
root.getBackupNeededModalFlag = function(walletId, cb) {
storage.get('showBackupNeededModal-' + walletId, cb);
};
root.setAmazonGiftCards = function(network, gcs, cb) {
storage.set('amazonGiftCards-' + network, gcs, cb);
};

View file

@ -83,11 +83,11 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
wallet.notAuthorized = true;
$state.go('tabs.home');
} else if (err instanceof errors.NOT_FOUND) {
popupService.showAlert(gettextCatalog.getString('Could not access Wallet Service: Not found'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not access Wallet Service: Not found'));
} else {
var msg = ""
$rootScope.$emit('Local/ClientError', (err.error ? err.error : err));
popupService.showAlert(bwcError.msg(err, gettextCatalog.getString('Error at Wallet Service')));
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err, gettextCatalog.getString('Error at Wallet Service')));
}
};
root.handleError = lodash.debounce(_handleError, 1000);

View file

@ -69,5 +69,9 @@
}
}
.modal-backdrop.active {
background: rgba(0, 0, 0, .8);
}
@import "backup-needed-modal";
@import "screenshot-warning-model";

View file

@ -19,4 +19,9 @@
text-align: left;
margin: 1rem;
}
.item-img-buy,
.item-img-sell {
vertical-align: middle;
margin-right: 10px;
}
}

View file

@ -103,4 +103,19 @@
}
}
}
.release {
cursor: pointer;
cursor: hand;
background-color: #E9E9EC;
padding-top: 30px;
padding-bottom: 20px;
text-align: center;
color: #444;
i {
margin-top: 1px;
font-size: 20px;
margin-left: 10px;
position: absolute;
}
}
}

View file

@ -71,4 +71,5 @@
}
}
}
.scroll{height: 100%;}
}

View file

@ -3,7 +3,7 @@
color: $dark-gray;
border-color: rgba(221, 221, 221, 0.3);
}
&-explaination, &-button-group {
&-explanation, &-button-group {
padding: 0 1rem;
margin: 1rem 0;
}

View file

@ -61,6 +61,12 @@
.tx-search:before {
font-size: 22px !important;
}
.description {
background-color: #f2f2f2;
text-align: center;
font-size: 13px;
color: $mid-gray;
}
}
.wallet-details-wallet-info {