Merge branch 'ref/design' of github.com:bitpay/bitpay-wallet into scanHandling

This commit is contained in:
Marty Alcala 2016-10-19 16:36:32 -04:00
commit 01d5e1d2eb
36 changed files with 332 additions and 145 deletions

View file

@ -139,7 +139,6 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
$scope.wallets = profileService.getWallets({
network: $scope.network,
n: 1,
onlyComplete: true
});
});

View file

@ -1,14 +1,29 @@
'use strict';
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService) {
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, $interval) {
$ionicConfig.views.swipeBackEnabled(false);
$scope.walletId = $stateParams.walletId;
$scope.allowNotif = function() {
$scope.notificationDialogOpen = true;
$timeout(function() {
profileService.pushNotificationsInit();
});
$scope.notificationPromise = $interval(function() {
PushNotification.hasPermission(function(data) {
if (data.isEnabled) {
$interval.cancel($scope.notificationPromise);
$state.go('onboarding.backupRequest', {
walletId: $scope.walletId
});
}
});
}, 100);
}
$scope.continue = function() {
$interval.cancel($scope.notificationPromise);
$state.go('onboarding.backupRequest', {
walletId: $scope.walletId
});

View file

@ -113,10 +113,13 @@ angular.module('copayApp.directives')
}
}
})
.directive('contact', ['addressbookService', 'lodash',
function(addressbookService, lodash) {
.directive('contact', ['addressbookService', 'lodash', 'gettextCatalog',
function(addressbookService, lodash, gettextCatalog) {
return {
restrict: 'E',
scope: {
label: '='
},
link: function(scope, element, attrs) {
var addr = attrs.address;
addressbookService.get(addr, function(err, ab) {
@ -124,7 +127,11 @@ angular.module('copayApp.directives')
var name = lodash.isObject(ab) ? ab.name : ab;
element.append(name);
} else {
element.append(addr);
if (scope.label && scope.label == 'Sent') {
element.append(gettextCatalog.getString('Sent'));
} else {
element.append(addr);
}
}
});
}

View file

@ -12,9 +12,10 @@ angular.module('copayApp.directives')
email: '@'
},
link: function(scope, el, attr) {
scope.emailHash = md5.createHash(scope.email || '');
if(typeof scope.email === "string"){
scope.emailHash = md5.createHash(scope.email.toLowerCase() || '');
}
},
template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="https://secure.gravatar.com/avatar/{{ emailHash }}.jpg?s={{ width }}&d=mm">'
}
});

View file

@ -23,10 +23,10 @@ angular.module('copayApp.services').factory('configService', function(storageSer
reconnectDelay: 5000,
idleDurationMin: 4,
settings: {
unitName: 'bits',
unitName: 'BTC',
unitToSatoshi: 100,
unitDecimals: 2,
unitCode: 'bit',
unitCode: 'btc',
alternativeName: 'US Dollar',
alternativeIsoCode: 'USD',
}

View file

@ -601,6 +601,16 @@ angular.module('copayApp.services')
$log.debug('Importing Wallet:', opts);
try {
var c = JSON.parse(str);
if (c.xPrivKey && c.xPrivKeyEncrypted) {
$log.warn('Found both encrypted and decrypted key. Deleting the encrypted version');
delete c.xPrivKeyEncrypted;
delete c.mnemonicEncrypted;
}
str = JSON.stringify(c);
walletClient.import(str, {
compressed: opts.compressed,
password: opts.password
@ -609,14 +619,6 @@ angular.module('copayApp.services')
return cb(gettext('Could not import. Check input file and spending password'));
}
str = JSON.parse(str);
if (str.xPrivKey && str.xPrivKeyEncrypted) {
$log.warn('Found both encrypted and decrypted key. Deleting the encrypted version');
delete str.xPrivKeyEncrypted;
delete str.mnemonicEncrypted;
}
var addressBook = str.addressBook || {};
addAndBindWalletClient(walletClient, {