adds trezor support to isDevel

This commit is contained in:
Matias Alejo Garcia 2015-11-05 16:00:38 -03:00
commit 5abf35c68c
5 changed files with 52 additions and 37 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile, isChromeApp) {
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile, isChromeApp, isDevel) {
var self = this;
var defaults = configService.getDefaults();
@ -50,19 +50,19 @@ angular.module('copayApp.controllers').controller('createController',
label: gettext('Specify Seed...'),
}];
$scope.seedSource = self.seedOptions[0];
if (!isChromeApp) return;
if (n > 1)
if (n > 1 && isChromeApp)
self.seedOptions.push({
id: 'ledger',
label: gettext('Ledger Hardware Wallet'),
});
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
if (isChromeApp || isDevel) {
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
}
};
this.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('importController',
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor, isChromeApp) {
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor, isChromeApp, isDevel) {
var self = this;
var reader = new FileReader();
@ -19,18 +19,21 @@ angular.module('copayApp.controllers').controller('importController',
var updateSeedSourceSelect = function() {
self.seedOptions = [];
if (!isChromeApp) return;
self.seedOptions.push({
id: 'ledger',
label: gettext('Ledger Hardware Wallet'),
});
if (isChromeApp) {
self.seedOptions.push({
id: 'ledger',
label: gettext('Ledger Hardware Wallet'),
});
}
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
$scope.seedSource = self.seedOptions[0];
if (isChromeApp || isDevel) {
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
$scope.seedSource = self.seedOptions[0];
}
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, isChromeApp) {
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, isChromeApp, isDevel) {
var self = this;
var defaults = configService.getDefaults();
@ -25,17 +25,21 @@ angular.module('copayApp.controllers').controller('joinController',
label: gettext('Specify Seed...'),
}];
$scope.seedSource = self.seedOptions[0];
if (!isChromeApp) return;
self.seedOptions.push({
id: 'ledger',
label: gettext('Ledger Hardware Wallet'),
});
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
if (isChromeApp) {
self.seedOptions.push({
id: 'ledger',
label: gettext('Ledger Hardware Wallet'),
});
}
if (isChromeApp || isDevel) {
self.seedOptions.push({
id: 'trezor',
label: gettext('Trezor Hardware Wallet'),
});
}
};
this.setSeedSource = function(src) {