+
-
-
-
- Failed to export
-
-
-
-
-
- Show advanced options
- Hide advanced options
-
-
-
- Do not include private key
-
-
-
-
-
-
- WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export.
-
-
-
-
-
-
-
-
- WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export.
-
-
-
-
-
-
-
-
-
Export options
-
-
-
+
+
-
-
-
Wallet Export
-
-
-
-
-
- Copy this text as it is to a safe place (notepad or email)
-
-
-
-
-
+
+ Show advanced options
+ Hide advanced options
+
+
+
+
+ Do not include private key
+
+
+
+
+
+
+
+ WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export.
+
+
+
+
+
+
+
+
+ WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export.
+
+
+
+
+
+
+
+
+
+
Export options
+
+
+
+
+
+
+
+
+
+
Copy this text as it is to a safe place (notepad or email)
+
+
\ No newline at end of file
diff --git a/public/views/tab-export-qrCode.html b/public/views/tab-export-qrCode.html
index b6254e42d..18ca08122 100644
--- a/public/views/tab-export-qrCode.html
+++ b/public/views/tab-export-qrCode.html
@@ -1,25 +1,10 @@
-
+
Exporting via QR not supported for this wallet
+
diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js
index 1e4d78e47..5dd718955 100644
--- a/src/js/controllers/export.js
+++ b/src/js/controllers/export.js
@@ -1,20 +1,15 @@
'use strict';
angular.module('copayApp.controllers').controller('exportController',
- function($rootScope, $scope, $timeout, $log, $ionicHistory, lodash, backupService, walletService, storageService, profileService, platformInfo, gettext, gettextCatalog, $state, $stateParams, popupService) {
- var prevState;
- var isWP = platformInfo.isWP;
- var isAndroid = platformInfo.isAndroid;
-
+ function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) {
var wallet = profileService.getWallet($stateParams.walletId);
- $scope.isEncrypted = wallet.isPrivKeyEncrypted();
- $scope.isCordova = platformInfo.isCordova;
- $scope.isSafari = platformInfo.isSafari;
$scope.init = function() {
- $scope.supported = true;
- $scope.exportQR = false;
- $scope.noSignEnabled = false;
+ $scope.formData = {};
+ $scope.isEncrypted = wallet.isPrivKeyEncrypted();
+ $scope.isCordova = platformInfo.isCordova;
+ $scope.isSafari = platformInfo.isSafari;
+ $scope.formData.noSignEnabled = false;
$scope.showAdvanced = false;
$scope.wallet = wallet;
$scope.canSign = wallet.canSign();
@@ -22,13 +17,15 @@ angular.module('copayApp.controllers').controller('exportController',
walletService.getEncodedWalletInfo(wallet, function(err, code) {
if (err || !code) {
$log.warn(err);
- return $state.go('wallet.preferencesAdvanced')
+ return $ionicHistory.goBack();
}
if (!code)
- $scope.supported = false;
- else
- $scope.exportWalletInfo = code;
+ $scope.formData.supported = false;
+ else {
+ $scope.formData.supported = true;
+ $scope.formData.exportWalletInfo = code;
+ }
$timeout(function() {
$scope.$apply();
@@ -38,14 +35,25 @@ angular.module('copayApp.controllers').controller('exportController',
/*
EXPORT WITHOUT PRIVATE KEY - PENDING
+ */
$scope.noSignEnabledChange = function() {
- $scope.exportWalletInfo = encodeWalletInfo();
- $timeout(function() {
- $scope.$apply();
- }, 1);
+ if (!$scope.formData.supported) return;
+
+ walletService.getEncodedWalletInfo(wallet, function(err, code) {
+ if (err) {
+ $log.error(err);
+ $scope.formData.supported = false;
+ $scope.formData.exportWalletInfo = null;
+ } else {
+ $scope.formData.supported = true;
+ $scope.formData.exportWalletInfo = code;
+ }
+ $timeout(function() {
+ $scope.$apply();
+ }, 1);
+ });
};
- */
$scope.downloadWalletBackup = function() {
$scope.getAddressbook(function(err, localAddressBook) {
@@ -54,11 +62,11 @@ angular.module('copayApp.controllers').controller('exportController',
return;
}
var opts = {
- noSign: $scope.noSignEnabled,
+ noSign: $scope.formData.noSignEnabled,
addressBook: localAddressBook
};
- backupService.walletDownload($scope.password, opts, function(err) {
+ backupService.walletDownload($scope.formData.password, opts, function(err) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export'));
return;
@@ -91,11 +99,11 @@ angular.module('copayApp.controllers').controller('exportController',
return cb(null);
}
var opts = {
- noSign: $scope.noSignEnabled,
+ noSign: $scope.formData.noSignEnabled,
addressBook: localAddressBook
};
- var ew = backupService.walletExport($scope.password, opts);
+ var ew = backupService.walletExport($scope.formData.password, opts);
if (!ew) {
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export'));
}
@@ -132,7 +140,7 @@ angular.module('copayApp.controllers').controller('exportController',
var ew = backup;
if (!ew) return;
- if ($scope.noSignEnabled)
+ if ($scope.formData.noSignEnabled)
name = name + '(No Private Key)';
var subject = 'Copay Wallet Backup: ' + name;
diff --git a/src/js/routes.js b/src/js/routes.js
index 209627a30..0f858cc81 100644
--- a/src/js/routes.js
+++ b/src/js/routes.js
@@ -434,7 +434,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
.state('tabs.preferences.export', {
- abstract: true,
url: '/export',
views: {
'preferences': {
@@ -442,24 +441,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
- .state('tabs.preferences.export.file', {
- url: '/tab-export-file',
- needProfile: true,
- views: {
- 'tab-export-file': {
- templateUrl: 'views/tab-export-file.html',
- },
- }
- })
- .state('tabs.preferences.export.qrCode', {
- url: '/tab-export-qrCode',
- needProfile: true,
- views: {
- 'tab-export-qrCode': {
- templateUrl: 'views/tab-export-qrCode.html',
- },
- }
- })
.state('tabs.preferences.preferencesBwsUrl', {
url: '/preferencesBwsUrl',
views: {