Adds cache for preferences, walletDetails
This commit is contained in:
parent
2a9c3c82e9
commit
ca292813eb
44 changed files with 271 additions and 241 deletions
|
|
@ -53,7 +53,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
|
|||
}, 100);
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
initAddressbook();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,5 @@
|
|||
angular.module('copayApp.controllers').controller('paperWalletController',
|
||||
function($scope, $timeout, $log, $ionicModal, $ionicHistory, popupService, gettextCatalog, platformInfo, configService, profileService, $state, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var rawTx;
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.wallet = wallet;
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.needsBackup = wallet.needsBackup;
|
||||
$scope.walletAlias = wallet.name;
|
||||
$scope.walletName = wallet.credentials.walletName;
|
||||
$scope.formData = {};
|
||||
$scope.formData.inputData = null;
|
||||
$scope.scannedKey = null;
|
||||
$scope.balance = null;
|
||||
$scope.balanceSat = null;
|
||||
$scope.scanned = false;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
};
|
||||
|
||||
$scope.onQrCodeScanned = function(data) {
|
||||
$scope.formData.inputData = data;
|
||||
|
|
@ -138,4 +119,22 @@ angular.module('copayApp.controllers').controller('paperWalletController',
|
|||
$scope.txStatusModal.show();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.wallet = wallet;
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.needsBackup = wallet.needsBackup;
|
||||
$scope.walletAlias = wallet.name;
|
||||
$scope.walletName = wallet.credentials.walletName;
|
||||
$scope.formData = {};
|
||||
$scope.formData.inputData = null;
|
||||
$scope.scannedKey = null;
|
||||
$scope.balance = null;
|
||||
$scope.balanceSat = null;
|
||||
$scope.scanned = false;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,33 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesController',
|
||||
function($scope, $rootScope, $timeout, $log, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService, fingerprintService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Wallet Preferences'));
|
||||
function($scope, $rootScope, $timeout, $log, $stateParams, $ionicHistory, gettextCatalog, configService, profileService, fingerprintService, walletService) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.credentials.walletId;
|
||||
$scope.wallet = wallet;
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.externalSource = null;
|
||||
|
||||
if (!wallet)
|
||||
return $ionicHistory.goBack();
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
$scope.encryptEnabled = walletService.isEncrypted(wallet);
|
||||
if (wallet.isPrivKeyExternal)
|
||||
$scope.externalSource = wallet.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor';
|
||||
|
||||
$scope.touchIdAvailable = fingerprintService.isAvailable();
|
||||
$scope.touchIdEnabled = config.touchIdFor ? config.touchIdFor[walletId] : null;
|
||||
|
||||
$scope.deleted = false;
|
||||
if (wallet.credentials && !wallet.credentials.mnemonicEncrypted && !wallet.credentials.mnemonic) {
|
||||
$scope.deleted = true;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.encryptChange = function() {
|
||||
if (!wallet) return;
|
||||
var val = $scope.encryptEnabled;
|
||||
|
|
@ -77,4 +55,25 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
$log.debug('Touch Id status changed: ' + newStatus);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
$scope.externalSource = null;
|
||||
|
||||
if (!wallet)
|
||||
return $ionicHistory.goBack();
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
$scope.encryptEnabled = walletService.isEncrypted(wallet);
|
||||
if (wallet.isPrivKeyExternal)
|
||||
$scope.externalSource = wallet.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor';
|
||||
|
||||
$scope.touchIdAvailable = fingerprintService.isAvailable();
|
||||
$scope.touchIdEnabled = config.touchIdFor ? config.touchIdFor[walletId] : null;
|
||||
|
||||
$scope.deleted = false;
|
||||
if (wallet.credentials && !wallet.credentials.mnemonicEncrypted && !wallet.credentials.mnemonic) {
|
||||
$scope.deleted = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('preferencesAbout',
|
||||
function($scope, $window, $ionicNavBarDelegate, gettextCatalog, externalLinkService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('About') + ' ' + $window.appConfig.nameCase);
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('About') + ' ' + $window.appConfig.nameCase);
|
||||
});
|
||||
|
||||
$scope.version = $window.version;
|
||||
$scope.commitHash = $window.commitHash;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesAliasController',
|
||||
function($scope, $timeout, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Alias'));
|
||||
function($scope, $timeout, $stateParams, $ionicHistory, gettextCatalog, configService, profileService, walletService) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.wallet = wallet;
|
||||
var walletId = wallet.credentials.walletId;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
|
||||
function($scope, $log, $timeout, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, rateService, lodash, profileService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Alternative Currency'));
|
||||
function($scope, $log, $timeout, $ionicHistory, gettextCatalog, configService, rateService, lodash, profileService, walletService) {
|
||||
|
||||
var next = 10;
|
||||
var completeAlternativeList;
|
||||
|
||||
$scope.init = function() {
|
||||
var config = configService.getSync();
|
||||
$scope.currentCurrency = config.wallet.settings.alternativeIsoCode;
|
||||
$scope.listComplete = false;
|
||||
|
||||
var config = configService.getSync();
|
||||
$scope.currentCurrency = config.wallet.settings.alternativeIsoCode;
|
||||
$scope.listComplete = false;
|
||||
|
||||
rateService.whenAvailable(function() {
|
||||
completeAlternativeList = rateService.listAlternatives();
|
||||
lodash.remove(completeAlternativeList, function(c) {
|
||||
return c.isoCode == 'BTC';
|
||||
});
|
||||
$scope.altCurrencyList = completeAlternativeList.slice(0, next);
|
||||
rateService.whenAvailable(function() {
|
||||
completeAlternativeList = rateService.listAlternatives();
|
||||
lodash.remove(completeAlternativeList, function(c) {
|
||||
return c.isoCode == 'BTC';
|
||||
});
|
||||
};
|
||||
$scope.altCurrencyList = completeAlternativeList.slice(0, next);
|
||||
});
|
||||
|
||||
$scope.loadMore = function() {
|
||||
$timeout(function() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
|
||||
function($scope, $log, $stateParams, $ionicNavBarDelegate, configService, applicationService, profileService, storageService) {
|
||||
$ionicNavBarDelegate.title('Wallet Service URL');
|
||||
function($scope, $log, $stateParams, configService, applicationService, profileService, storageService) {
|
||||
$scope.success = null;
|
||||
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Color'));
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, $stateParams, $ionicHistory, gettextCatalog, configService, profileService) {
|
||||
$scope.colorList = [
|
||||
'#DD4B39',
|
||||
'#F38F12',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||
function($scope, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Delete'));
|
||||
function($scope, $stateParams, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' ';
|
||||
$scope.walletName = '[' + wallet.credentials.walletName + ']';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function($scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, confirmDialog, lodash, profileService, gettext) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Delete recovery phrase'));
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function($scope, $ionicHistory, $stateParams, gettextCatalog, confirmDialog, lodash, profileService, gettext) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var msg = gettext('Are you sure you want to delete the recovery phrase?');
|
||||
var successMsg = gettext('Recovery phrase deleted');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, profileService, walletService, configService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Email Notifications'));
|
||||
angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, gettextCatalog, profileService, walletService, configService) {
|
||||
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.credentials.walletId;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, feeService, ongoingProcess) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Bitcoin Network Fee Policy'));
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, $ionicHistory, gettextCatalog, configService, feeService, ongoingProcess) {
|
||||
|
||||
$scope.init = function() {
|
||||
ongoingProcess.set('gettingFeeLevels', true);
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
ongoingProcess.set('gettingFeeLevels', false);
|
||||
$scope.feeOpts = feeService.feeOpts;
|
||||
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
$scope.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
ongoingProcess.set('gettingFeeLevels', true);
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
ongoingProcess.set('gettingFeeLevels', false);
|
||||
$scope.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$scope.save = function(newFee) {
|
||||
var opts = {
|
||||
|
|
@ -32,4 +27,9 @@ angular.module('copayApp.controllers').controller('preferencesFeeController', fu
|
|||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.feeOpts = feeService.feeOpts;
|
||||
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,32 +3,6 @@
|
|||
angular.module('copayApp.controllers').controller('preferencesGlideraController',
|
||||
function($scope, $log, $timeout, $state, ongoingProcess, glideraService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.init = function(accessToken) {
|
||||
$scope.network = glideraService.getEnvironment();
|
||||
|
||||
$scope.token = accessToken;
|
||||
$scope.permissions = null;
|
||||
$scope.email = null;
|
||||
$scope.personalInfo = null;
|
||||
$scope.txs = null;
|
||||
$scope.status = null;
|
||||
$scope.limits = null;
|
||||
|
||||
ongoingProcess.set('connectingGlidera', true);
|
||||
glideraService.init($scope.token, function(err, glidera) {
|
||||
ongoingProcess.set('connectingGlidera');
|
||||
if (err || !glidera) {
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
$scope.token = glidera.token;
|
||||
$scope.permissions = glidera.permissions;
|
||||
$scope.update({
|
||||
fullUpdate: true
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function(opts) {
|
||||
if (!$scope.token || !$scope.permissions) return;
|
||||
$log.debug('Updating Glidera Account...');
|
||||
|
|
@ -75,4 +49,30 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController'
|
|||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.network = glideraService.getEnvironment();
|
||||
|
||||
$scope.token = accessToken;
|
||||
$scope.permissions = null;
|
||||
$scope.email = null;
|
||||
$scope.personalInfo = null;
|
||||
$scope.txs = null;
|
||||
$scope.status = null;
|
||||
$scope.limits = null;
|
||||
|
||||
ongoingProcess.set('connectingGlidera', true);
|
||||
glideraService.init($scope.token, function(err, glidera) {
|
||||
ongoingProcess.set('connectingGlidera');
|
||||
if (err || !glidera) {
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
$scope.token = glidera.token;
|
||||
$scope.permissions = glidera.permissions;
|
||||
$scope.update({
|
||||
fullUpdate: true
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesHistory',
|
||||
function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, storageService, platformInfo, profileService, lodash) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Transaction History'));
|
||||
function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, gettextCatalog, storageService, platformInfo, profileService, lodash) {
|
||||
$scope.wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.csvReady = false;
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
|
|
@ -131,4 +130,8 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
|
|||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.csvHistory();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||
function($scope, $log, $timeout, $ionicNavBarDelegate, $ionicHistory, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Wallet Information'));
|
||||
function($scope, $log, $timeout, $ionicHistory, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
|
||||
var base = 'xpub';
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.id;
|
||||
|
|
@ -12,45 +11,6 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
|||
$scope.isCordova = platformInfo.isCordova;
|
||||
config.colorFor = config.colorFor || {};
|
||||
|
||||
$scope.init = function() {
|
||||
var c = wallet.credentials;
|
||||
var basePath = c.getBaseAddressDerivationPath();
|
||||
|
||||
$scope.wallet = wallet;
|
||||
$scope.walletName = c.walletName;
|
||||
$scope.walletId = c.walletId;
|
||||
$scope.network = c.network;
|
||||
$scope.addressType = c.addressType || 'P2SH';
|
||||
$scope.derivationStrategy = c.derivationStrategy || 'BIP45';
|
||||
$scope.basePath = basePath;
|
||||
$scope.M = c.m;
|
||||
$scope.N = c.n;
|
||||
$scope.pubKeys = lodash.pluck(c.publicKeyRing, 'xPubKey');
|
||||
$scope.addrs = null;
|
||||
|
||||
wallet.getMainAddresses({
|
||||
doNotVerify: true
|
||||
}, function(err, addrs) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
};
|
||||
var last10 = [],
|
||||
i = 0,
|
||||
e = addrs.pop();
|
||||
while (i++ < 10 && e) {
|
||||
e.path = base + e.path.substring(1);
|
||||
last10.push(e);
|
||||
e = addrs.pop();
|
||||
}
|
||||
$scope.addrs = last10;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
$scope.sendAddrs = function() {
|
||||
function formatDate(ts) {
|
||||
var dateObj = new Date(ts * 1000);
|
||||
|
|
@ -121,6 +81,43 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
|||
$state.go('tabs.home');
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
var c = wallet.credentials;
|
||||
var basePath = c.getBaseAddressDerivationPath();
|
||||
|
||||
$scope.wallet = wallet;
|
||||
$scope.walletName = c.walletName;
|
||||
$scope.walletId = c.walletId;
|
||||
$scope.network = c.network;
|
||||
$scope.addressType = c.addressType || 'P2SH';
|
||||
$scope.derivationStrategy = c.derivationStrategy || 'BIP45';
|
||||
$scope.basePath = basePath;
|
||||
$scope.M = c.m;
|
||||
$scope.N = c.n;
|
||||
$scope.pubKeys = lodash.pluck(c.publicKeyRing, 'xPubKey');
|
||||
$scope.addrs = null;
|
||||
|
||||
wallet.getMainAddresses({
|
||||
doNotVerify: true
|
||||
}, function(err, addrs) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
};
|
||||
var last10 = [],
|
||||
i = 0,
|
||||
e = addrs.pop();
|
||||
while (i++ < 10 && e) {
|
||||
e.path = base + e.path.substring(1);
|
||||
last10.push(e);
|
||||
e = addrs.pop();
|
||||
}
|
||||
$scope.addrs = last10;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
||||
function($scope, $log, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, profileService, uxLanguage, walletService, externalLinkService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Language'));
|
||||
function($scope, $log, $ionicHistory, gettextCatalog, configService, profileService, uxLanguage, walletService, externalLinkService) {
|
||||
|
||||
$scope.availableLanguages = uxLanguage.getLanguages();
|
||||
|
||||
$scope.openExternalLink = function(url, target) {
|
||||
externalLinkService.open(url, target);
|
||||
};
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.availableLanguages = uxLanguage.getLanguages();
|
||||
$scope.currentLanguage = uxLanguage.getCurrentLanguage();
|
||||
}
|
||||
|
||||
$scope.save = function(newLang) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
|
|
@ -33,4 +29,8 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.currentLanguage = uxLanguage.getCurrentLanguage();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLogs',
|
||||
function($scope, historicLog, $ionicNavBarDelegate, gettextCatalog) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Session Log'));
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.logs = historicLog.get();
|
||||
}
|
||||
function($scope, historicLog, gettextCatalog) {
|
||||
|
||||
$scope.prepare = function() {
|
||||
var log = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n';
|
||||
|
|
@ -32,4 +27,8 @@ angular.module('copayApp.controllers').controller('preferencesLogs',
|
|||
function() {}
|
||||
);
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.logs = historicLog.get();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, walletService, profileService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Unit'));
|
||||
|
||||
$scope.init = function() {
|
||||
var config = configService.getSync();
|
||||
$scope.currentUnit = config.wallet.settings.unitCode;
|
||||
}
|
||||
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, $ionicHistory, gettextCatalog, walletService, profileService) {
|
||||
|
||||
var config = configService.getSync();
|
||||
$scope.unitList = [{
|
||||
name: 'bits (1,000,000 bits = 1BTC)',
|
||||
shortName: 'bits',
|
||||
|
|
@ -43,4 +38,8 @@ angular.module('copayApp.controllers').controller('preferencesUnitController', f
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.currentUnit = config.wallet.settings.unitCode;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,14 +8,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
$scope.openTxpModal = txpModalService.open;
|
||||
$scope.version = $window.version;
|
||||
$scope.name = $window.appConfig.nameCase;
|
||||
|
||||
$scope.homeTip = $stateParams.fromOnboarding;
|
||||
configService.whenAvailable(function() {
|
||||
var config = configService.getSync();
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||
});
|
||||
|
||||
$scope.openNotificationModal = function(n) {
|
||||
wallet = profileService.getWallet(n.walletId);
|
||||
|
|
@ -206,6 +199,12 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
configService.whenAvailable(function() {
|
||||
var config = configService.getSync();
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||
});
|
||||
$scope.nextStep();
|
||||
$scope.updateAllWallets();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
$scope.$digest();
|
||||
});
|
||||
}
|
||||
$scope.spendUnconfirmed = config.wallet.spendUnconfirmed;
|
||||
$scope.glideraEnabled = config.glidera.enabled;
|
||||
$scope.spendUnconfirmed = {value : config.wallet.spendUnconfirmed};
|
||||
$scope.glideraEnabled = {value: config.glidera.enabled};
|
||||
$scope.coinbaseEnabled = config.coinbase.enabled;
|
||||
$scope.pushNotifications = config.pushNotifications.enabled;
|
||||
$scope.pushNotifications = {value: config.pushNotifications.enabled};
|
||||
$scope.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) {
|
||||
return w.id != self.walletId;
|
||||
});
|
||||
|
|
@ -49,7 +49,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
$scope.spendUnconfirmedChange = function() {
|
||||
var opts = {
|
||||
wallet: {
|
||||
spendUnconfirmed: $scope.spendUnconfirmed
|
||||
spendUnconfirmed: $scope.spendUnconfirmed.value
|
||||
}
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
|
|
@ -60,7 +60,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
$scope.pushNotificationsChange = function() {
|
||||
var opts = {
|
||||
pushNotifications: {
|
||||
enabled: $scope.pushNotifications
|
||||
enabled: $scope.pushNotifications.value
|
||||
}
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
|
|
@ -75,7 +75,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
$scope.glideraChange = function() {
|
||||
var opts = {
|
||||
glidera: {
|
||||
enabled: $scope.glideraEnabled
|
||||
enabled: $scope.glideraEnabled.value
|
||||
}
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('termOfUseController',
|
||||
function($scope, $window, uxLanguage, $ionicNavBarDelegate, gettextCatalog, externalLinkService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Terms Of Use'));
|
||||
function($scope, $window, uxLanguage, gettextCatalog, externalLinkService) {
|
||||
$scope.lang = uxLanguage.currentLanguage;
|
||||
$scope.disclaimerUrl = $window.appConfig.disclaimerUrl;
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
currentTxHistoryPage = 0;
|
||||
$scope.completeTxHistory = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/language',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesLanguageController',
|
||||
templateUrl: 'views/preferencesLanguage.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -329,6 +330,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/unit',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesUnitController',
|
||||
templateUrl: 'views/preferencesUnit.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -337,6 +339,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/fee',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesFeeController',
|
||||
templateUrl: 'views/preferencesFee.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -345,6 +348,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/altCurrency',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesAltCurrencyController',
|
||||
templateUrl: 'views/preferencesAltCurrency.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -353,6 +357,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/about',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesAbout',
|
||||
templateUrl: 'views/preferencesAbout.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -361,6 +366,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/logs',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesLogs',
|
||||
templateUrl: 'views/preferencesLogs.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -369,6 +375,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/termsOfUse',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'termOfUseController',
|
||||
templateUrl: 'views/termsOfUse.html',
|
||||
}
|
||||
}
|
||||
|
|
@ -377,6 +384,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/translators',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'translatorsController',
|
||||
templateUrl: 'views/translators.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -388,19 +396,11 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
*
|
||||
*/
|
||||
|
||||
.state('tabs.preferences', {
|
||||
.state('tabs.preferences', {
|
||||
url: '/preferences/:walletId',
|
||||
abstract: true,
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
template: '<ion-nav-view name="preferences"></ion-nav-view>'
|
||||
},
|
||||
}
|
||||
})
|
||||
.state('tabs.preferences.main', {
|
||||
url: '/main',
|
||||
views: {
|
||||
'preferences': {
|
||||
controller: 'preferencesController',
|
||||
templateUrl: 'views/preferences.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -408,7 +408,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesAlias', {
|
||||
url: '/preferencesAlias',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesAliasController',
|
||||
templateUrl: 'views/preferencesAlias.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -416,7 +417,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesColor', {
|
||||
url: '/preferencesColor',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesColorController',
|
||||
templateUrl: 'views/preferencesColor.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -424,7 +426,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesEmail', {
|
||||
url: '/preferencesEmail',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesEmailController',
|
||||
templateUrl: 'views/preferencesEmail.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -432,7 +435,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.backup', {
|
||||
url: '/backup',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'backupController',
|
||||
templateUrl: 'views/backup.html'
|
||||
}
|
||||
|
|
@ -441,7 +444,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesAdvanced', {
|
||||
url: '/preferencesAdvanced',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesAdvancedController',
|
||||
templateUrl: 'views/preferencesAdvanced.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -449,7 +453,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.information', {
|
||||
url: '/information',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesInformation',
|
||||
templateUrl: 'views/preferencesInformation.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -457,7 +462,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.export', {
|
||||
url: '/export',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'exportController',
|
||||
templateUrl: 'views/export.html'
|
||||
}
|
||||
|
|
@ -466,7 +471,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesBwsUrl', {
|
||||
url: '/preferencesBwsUrl',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesBwsUrlController',
|
||||
templateUrl: 'views/preferencesBwsUrl.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -474,7 +480,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.preferencesHistory', {
|
||||
url: '/preferencesHistory',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesHistory',
|
||||
templateUrl: 'views/preferencesHistory.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -482,7 +489,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.deleteWords', {
|
||||
url: '/deleteWords',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesDeleteWordsController',
|
||||
templateUrl: 'views/preferencesDeleteWords.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -490,7 +498,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.delete', {
|
||||
url: '/delete',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesDeleteWalletController',
|
||||
templateUrl: 'views/preferencesDeleteWallet.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -498,7 +507,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.preferences.paperWallet', {
|
||||
url: '/paperWallet',
|
||||
views: {
|
||||
'preferences': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'paperWalletController',
|
||||
templateUrl: 'views/paperWallet.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -707,6 +717,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
url: '/preferences',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
controller: 'preferencesGlideraController',
|
||||
templateUrl: 'views/preferencesGlidera.html'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue