Wallet/src/js/controllers/preferencesExternal.js
2017-04-17 10:55:16 -04:00

28 lines
No EOL
1.1 KiB
JavaScript

'use strict';
angular.module('copayApp.controllers').controller('preferencesExternalController', function($scope, $stateParams, lodash, gettextCatalog, popupService, profileService, walletService) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.externalSource = lodash.find(walletService.externalSource, function(source) {
return source.id == wallet.getPrivKeyExternalSourceName();
});
if ($scope.externalSource.isEmbeddedHardware) {
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
$scope.showMneumonicFromHardwarePopup = function() {
var title = gettextCatalog.getString('Warning!');
var message = gettextCatalog.getString('Are you being watched? Anyone with your recovery phrase can access or spend your bitcoin.');
popupService.showConfirm(title, message, null, null, function(res) {
if (res) {
walletService.showMneumonicFromHardware(wallet, function(err) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
}
});
}
});
};
}
});