Adds cache for amount, backup, amazon, glidera, export, walletDetails
This commit is contained in:
parent
9cb0dc128c
commit
2a9c3c82e9
22 changed files with 181 additions and 165 deletions
|
|
@ -1,10 +1,13 @@
|
||||||
<ion-view id="view-amount">
|
<ion-view id="view-amount">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
|
<ion-nav-title>
|
||||||
|
{{'Enter Amount'|translate}}
|
||||||
|
</ion-nav-title>
|
||||||
<ion-nav-back-button>
|
<ion-nav-back-button>
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content scroll="false" class="amount" ng-controller="amountController" ng-init="init()">
|
<ion-content scroll="false">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="item item-no-bottom-border" translate>Recipient</div>
|
<div class="item item-no-bottom-border" translate>Recipient</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view id="wallet-backup-phrase" title="{{viewTitle}}" ng-controller="backupController" ng-init="init()">
|
<ion-view id="wallet-backup-phrase" title="{{viewTitle}}">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-buttons side="primary">
|
||||||
<button class="button button-back button-clear" ng-click="backupGoBack()">
|
<button class="button button-back button-clear" ng-click="backupGoBack()">
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<ion-nav-title>Buy</ion-nav-title>
|
<ion-nav-title>Buy</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="buyAmazonController as buy" ng-init="buy.init()">
|
<ion-content>
|
||||||
|
|
||||||
<div ng-show="!buy.giftCard">
|
<div ng-show="!buy.giftCard">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<ion-nav-title>Buy</ion-nav-title>
|
<ion-nav-title>Buy</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="buyGlideraController as buy" ng-init="init()">
|
<ion-content>
|
||||||
|
|
||||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||||
Testnet wallets only work with Glidera Sandbox Accounts
|
Testnet wallets only work with Glidera Sandbox Accounts
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view id="view-confirm" ng-controller="confirmController" ng-init="init()">
|
<ion-view id="view-confirm">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-title>
|
<ion-nav-title>
|
||||||
{{'Confirm'|translate}}
|
{{'Confirm'|translate}}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="exportController" ng-init="file = true; init();">
|
<ion-content ng-init="file = true">
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="col" ng-click="file = true" ng-style="file && {'border-bottom': '2px solid'}">
|
<div class="col" ng-click="file = true" ng-style="file && {'border-bottom': '2px solid'}">
|
||||||
<span class="" translate>File/Text</span>
|
<span class="" translate>File/Text</span>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<ion-nav-title>Glidera</ion-nav-title>
|
<ion-nav-title>Glidera</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="glideraController as glidera" ng-init="init()">
|
<ion-content>
|
||||||
|
|
||||||
<div class="box-notification error" ng-show="!network">
|
<div class="box-notification error" ng-show="!network">
|
||||||
Glidera is disabled for this application
|
Glidera is disabled for this application
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<ion-nav-title>Glidera</ion-nav-title>
|
<ion-nav-title>Glidera</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="glideraUriController" ng-init="checkCode()">
|
<ion-content>
|
||||||
|
|
||||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||||
Testnet wallets only work with Glidera Sandbox Accounts
|
Testnet wallets only work with Glidera Sandbox Accounts
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<ion-nav-title>Sell</ion-nav-title>
|
<ion-nav-title>Sell</ion-nav-title>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content ng-controller="sellGlideraController as sell" ng-init="init()">
|
<ion-content>
|
||||||
|
|
||||||
<div class="box-notification warning" ng-show="network == 'testnet'">
|
<div class="box-notification warning" ng-show="network == 'testnet'">
|
||||||
Testnet wallets only work with Glidera Sandbox Accounts
|
Testnet wallets only work with Glidera Sandbox Accounts
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<ion-view>
|
|
||||||
<ion-nav-bar class="bar-royal">
|
|
||||||
<ion-nav-title>{{'Scan' | translate}}</ion-nav-title>
|
|
||||||
</ion-nav-bar>
|
|
||||||
|
|
||||||
<ion-content class="padding" ng-controller="tabScanController" ng-init="init()">
|
|
||||||
|
|
||||||
<canvas id="qr-canvas" width="200" height="150"></canvas>
|
|
||||||
<video id="qrcode-scanner-video" width="300" height="225"></video>
|
|
||||||
|
|
||||||
</ion-content>
|
|
||||||
</ion-view>
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view id="walletDetails" ng-controller="walletDetailsController" ng-init="init()">
|
<ion-view id="walletDetails">
|
||||||
<ion-nav-bar ng-style="{'background-color': walletDetailsColor}">
|
<ion-nav-bar ng-style="{'background-color': walletDetailsColor}">
|
||||||
<ion-nav-title>{{walletDetailsName}}</ion-nav-title>
|
<ion-nav-title>{{walletDetailsName}}</ion-nav-title>
|
||||||
<ion-nav-back-button>
|
<ion-nav-back-button>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
||||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount'));
|
|
||||||
|
|
||||||
var unitToSatoshi;
|
var unitToSatoshi;
|
||||||
var satToUnit;
|
var satToUnit;
|
||||||
|
|
@ -11,7 +10,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
var SMALL_FONT_SIZE_LIMIT = 13;
|
var SMALL_FONT_SIZE_LIMIT = 13;
|
||||||
var LENGTH_EXPRESSION_LIMIT = 19;
|
var LENGTH_EXPRESSION_LIMIT = 19;
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
|
||||||
if (!$stateParams.toAddress) {
|
if (!$stateParams.toAddress) {
|
||||||
$log.error('Bad params at amount')
|
$log.error('Bad params at amount')
|
||||||
|
|
@ -73,7 +72,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$ionicScrollDelegate.resize();
|
$ionicScrollDelegate.resize();
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
});
|
||||||
|
|
||||||
$scope.toggleAlternative = function() {
|
$scope.toggleAlternative = function() {
|
||||||
$scope.showAlternativeAmount = !$scope.showAlternativeAmount;
|
$scope.showAlternativeAmount = !$scope.showAlternativeAmount;
|
||||||
|
|
|
||||||
|
|
@ -16,25 +16,6 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function() {
|
|
||||||
$scope.deleted = isDeletedSeed();
|
|
||||||
if ($scope.deleted) {
|
|
||||||
$log.debug('no mnemonics');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
walletService.getKeys(wallet, function(err, k) {
|
|
||||||
if (err || !k) {
|
|
||||||
$log.error('Could not get keys: ', err);
|
|
||||||
$state.go('wallet.preferences');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$scope.credentialsEncrypted = false;
|
|
||||||
keys = k;
|
|
||||||
$scope.initFlow();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var shuffledWords = function(words) {
|
var shuffledWords = function(words) {
|
||||||
var sort = lodash.sortBy(words);
|
var sort = lodash.sortBy(words);
|
||||||
|
|
||||||
|
|
@ -222,4 +203,23 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
$scope.deleted = isDeletedSeed();
|
||||||
|
if ($scope.deleted) {
|
||||||
|
$log.debug('no mnemonics');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
walletService.getKeys(wallet, function(err, k) {
|
||||||
|
if (err || !k) {
|
||||||
|
$log.error('Could not get keys: ', err);
|
||||||
|
$state.go('wallet.preferences');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.credentialsEncrypted = false;
|
||||||
|
keys = k;
|
||||||
|
$scope.initFlow();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
externalLinkService.open(url, target);
|
externalLinkService.open(url, target);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.init = function() {
|
|
||||||
var network = amazonService.getEnvironment();
|
|
||||||
$scope.wallets = profileService.getWallets({
|
|
||||||
network: network,
|
|
||||||
onlyComplete: true
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.confirm = function() {
|
this.confirm = function() {
|
||||||
var message = gettextCatalog.getString('Amazon.com Gift Card purchase for ${{amount}} USD', {amount: $scope.fiat});
|
var message = gettextCatalog.getString('Amazon.com Gift Card purchase for ${{amount}} USD', {amount: $scope.fiat});
|
||||||
var ok = gettextCatalog.getString('Buy');
|
var ok = gettextCatalog.getString('Buy');
|
||||||
|
|
@ -216,4 +208,12 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
var network = amazonService.getEnvironment();
|
||||||
|
$scope.wallets = profileService.getWallets({
|
||||||
|
network: network,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -17,36 +17,6 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
$log.debug('Wallet changed: ' + w.name);
|
$log.debug('Wallet changed: ' + w.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
$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.wallets = profileService.getWallets({
|
|
||||||
network: $scope.network,
|
|
||||||
n: 1,
|
|
||||||
onlyComplete: true
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.update = function(opts) {
|
$scope.update = function(opts) {
|
||||||
if (!$scope.token || !$scope.permissions) return;
|
if (!$scope.token || !$scope.permissions) return;
|
||||||
$log.debug('Updating Glidera Account...');
|
$log.debug('Updating Glidera Account...');
|
||||||
|
|
@ -145,4 +115,34 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$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});
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.wallets = profileService.getWallets({
|
||||||
|
network: $scope.network,
|
||||||
|
n: 1,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
var cachedTxp = {};
|
var cachedTxp = {};
|
||||||
var isChromeApp = platformInfo.isChromeApp;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
|
|
||||||
$scope.init = function() {
|
var initConfirm = function() {
|
||||||
if ($stateParams.paypro) {
|
if ($stateParams.paypro) {
|
||||||
return setFromPayPro($stateParams.paypro, function(err) {
|
return setFromPayPro($stateParams.paypro, function(err) {
|
||||||
if (err && !isChromeApp) {
|
if (err && !isChromeApp) {
|
||||||
|
|
@ -145,7 +145,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
$stateParams.paypro = null;
|
$stateParams.paypro = null;
|
||||||
|
|
||||||
$scope._paypro = paypro;
|
$scope._paypro = paypro;
|
||||||
return $scope.init();
|
return initConfirm();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -307,4 +307,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$state.go('tabs.send');
|
$state.go('tabs.send');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
initConfirm();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
||||||
function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) {
|
function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) {
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
|
|
||||||
$scope.init = function() {
|
var init = function() {
|
||||||
$scope.formData = {};
|
$scope.formData = {};
|
||||||
$scope.isEncrypted = wallet.isPrivKeyEncrypted();
|
$scope.isEncrypted = wallet.isPrivKeyEncrypted();
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
|
|
@ -158,4 +158,8 @@ angular.module('copayApp.controllers').controller('exportController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
externalLinkService.open(url, target);
|
externalLinkService.open(url, target);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function(accessToken) {
|
var initGlidera = function(accessToken) {
|
||||||
$scope.network = glideraService.getEnvironment();
|
$scope.network = glideraService.getEnvironment();
|
||||||
|
|
||||||
$scope.token = null;
|
$scope.token = null;
|
||||||
|
|
@ -78,7 +78,7 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||||
} else if (data && data.access_token) {
|
} else if (data && data.access_token) {
|
||||||
storageService.setGlideraToken($scope.network, data.access_token, function() {
|
storageService.setGlideraToken($scope.network, data.access_token, function() {
|
||||||
$scope.init(data.access_token);
|
initGlidera(data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
@ -113,4 +113,8 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
initGlidera();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.checkCode = function() {
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
if ($stateParams.url) {
|
if ($stateParams.url) {
|
||||||
var match = $stateParams.url.match(/code=(.+)/);
|
var match = $stateParams.url.match(/code=(.+)/);
|
||||||
if (match && match[1]) {
|
if (match && match[1]) {
|
||||||
|
|
@ -32,5 +32,5 @@ angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$log.error('Bad state: ' + JSON.stringify($stateParams));
|
$log.error('Bad state: ' + JSON.stringify($stateParams));
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,36 +18,6 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
$log.debug('Wallet changed: ' + w.name);
|
$log.debug('Wallet changed: ' + w.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
$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.wallets = profileService.getWallets({
|
|
||||||
network: $scope.network,
|
|
||||||
n: 1,
|
|
||||||
onlyComplete: true
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.update = function(opts) {
|
$scope.update = function(opts) {
|
||||||
if (!$scope.token || !$scope.permissions) return;
|
if (!$scope.token || !$scope.permissions) return;
|
||||||
$log.debug('Updating Glidera Account...');
|
$log.debug('Updating Glidera Account...');
|
||||||
|
|
@ -217,4 +187,34 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$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});
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.wallets = profileService.getWallets({
|
||||||
|
network: $scope.network,
|
||||||
|
n: 1,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,49 +15,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
||||||
externalLinkService.open(url, target);
|
externalLinkService.open(url, target);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function() {
|
|
||||||
currentTxHistoryPage = 0;
|
|
||||||
$scope.completeTxHistory = [];
|
|
||||||
|
|
||||||
wallet = profileService.getWallet($stateParams.walletId);
|
|
||||||
|
|
||||||
/* Set color for header bar */
|
|
||||||
$rootScope.walletDetailsColor = wallet.color;
|
|
||||||
$rootScope.walletDetailsName = wallet.name;
|
|
||||||
$scope.wallet = wallet;
|
|
||||||
|
|
||||||
$scope.requiresMultipleSignatures = wallet.credentials.m > 1;
|
|
||||||
$scope.newTx = false;
|
|
||||||
|
|
||||||
$ionicNavBarDelegate.title(wallet.name);
|
|
||||||
|
|
||||||
$scope.updateAll(function() {
|
|
||||||
if ($stateParams.txid) {
|
|
||||||
var tx = lodash.find($scope.completeTxHistory, {
|
|
||||||
txid: $stateParams.txid
|
|
||||||
});
|
|
||||||
if (tx) {
|
|
||||||
$scope.openTxModal(tx);
|
|
||||||
} else {
|
|
||||||
$ionicPopup.alert({
|
|
||||||
title: gettext('TX not available'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if ($stateParams.txpId) {
|
|
||||||
var txp = lodash.find($scope.txps, {
|
|
||||||
id: $stateParams.txpId
|
|
||||||
});
|
|
||||||
if (txp) {
|
|
||||||
$scope.openTxpModal(txp);
|
|
||||||
} else {
|
|
||||||
$ionicPopup.alert({
|
|
||||||
title: gettext('Proposal not longer available'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var setPendingTxps = function(txps) {
|
var setPendingTxps = function(txps) {
|
||||||
|
|
||||||
/* Uncomment to test multiple outputs */
|
/* Uncomment to test multiple outputs */
|
||||||
|
|
@ -232,11 +189,54 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
||||||
$scope.updateAll = function(cb) {
|
$scope.updateAll = function(cb) {
|
||||||
$scope.updateStatus(false);
|
$scope.updateStatus(false);
|
||||||
$scope.updateTxHistory(cb);
|
$scope.updateTxHistory(cb);
|
||||||
}
|
};
|
||||||
|
|
||||||
$scope.hideToggle = function() {
|
$scope.hideToggle = function() {
|
||||||
profileService.toggleHideBalanceFlag(wallet.credentials.walletId, function(err) {
|
profileService.toggleHideBalanceFlag(wallet.credentials.walletId, function(err) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data){
|
||||||
|
currentTxHistoryPage = 0;
|
||||||
|
$scope.completeTxHistory = [];
|
||||||
|
|
||||||
|
wallet = profileService.getWallet($stateParams.walletId);
|
||||||
|
|
||||||
|
/* Set color for header bar */
|
||||||
|
$rootScope.walletDetailsColor = wallet.color;
|
||||||
|
$rootScope.walletDetailsName = wallet.name;
|
||||||
|
$scope.wallet = wallet;
|
||||||
|
|
||||||
|
$scope.requiresMultipleSignatures = wallet.credentials.m > 1;
|
||||||
|
$scope.newTx = false;
|
||||||
|
|
||||||
|
$ionicNavBarDelegate.title(wallet.name);
|
||||||
|
|
||||||
|
$scope.updateAll(function() {
|
||||||
|
if ($stateParams.txid) {
|
||||||
|
var tx = lodash.find($scope.completeTxHistory, {
|
||||||
|
txid: $stateParams.txid
|
||||||
|
});
|
||||||
|
if (tx) {
|
||||||
|
$scope.openTxModal(tx);
|
||||||
|
} else {
|
||||||
|
$ionicPopup.alert({
|
||||||
|
title: gettext('TX not available'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if ($stateParams.txpId) {
|
||||||
|
var txp = lodash.find($scope.txps, {
|
||||||
|
id: $stateParams.txpId
|
||||||
|
});
|
||||||
|
if (txp) {
|
||||||
|
$scope.openTxpModal(txp);
|
||||||
|
} else {
|
||||||
|
$ionicPopup.alert({
|
||||||
|
title: gettext('Proposal not longer available'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
})
|
})
|
||||||
.state('uriglidera', {
|
.state('uriglidera', {
|
||||||
url: '/uri-glidera/:url',
|
url: '/uri-glidera/:url',
|
||||||
|
controller: 'glideraUriController',
|
||||||
templateUrl: 'views/glideraUri.html'
|
templateUrl: 'views/glideraUri.html'
|
||||||
})
|
})
|
||||||
.state('uricoinbase', {
|
.state('uricoinbase', {
|
||||||
|
|
@ -153,6 +154,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/details/{walletId}/{fromOnboarding}',
|
url: '/details/{walletId}/{fromOnboarding}',
|
||||||
views: {
|
views: {
|
||||||
'tab-home': {
|
'tab-home': {
|
||||||
|
controller: 'walletDetailsController',
|
||||||
templateUrl: 'views/walletDetails.html'
|
templateUrl: 'views/walletDetails.html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -238,6 +240,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/amount/:toAddress/:toName/:toEmail',
|
url: '/amount/:toAddress/:toName/:toEmail',
|
||||||
views: {
|
views: {
|
||||||
'tab-send@tabs': {
|
'tab-send@tabs': {
|
||||||
|
controller: 'amountController',
|
||||||
templateUrl: 'views/amount.html'
|
templateUrl: 'views/amount.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -246,6 +249,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
||||||
views: {
|
views: {
|
||||||
'tab-send@tabs': {
|
'tab-send@tabs': {
|
||||||
|
controller: 'confirmController',
|
||||||
templateUrl: 'views/confirm.html'
|
templateUrl: 'views/confirm.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -429,6 +433,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/backup',
|
url: '/backup',
|
||||||
views: {
|
views: {
|
||||||
'preferences': {
|
'preferences': {
|
||||||
|
controller: 'backupController',
|
||||||
templateUrl: 'views/backup.html'
|
templateUrl: 'views/backup.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -453,6 +458,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/export',
|
url: '/export',
|
||||||
views: {
|
views: {
|
||||||
'preferences': {
|
'preferences': {
|
||||||
|
controller: 'exportController',
|
||||||
templateUrl: 'views/export.html'
|
templateUrl: 'views/export.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -671,6 +677,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/glidera',
|
url: '/glidera',
|
||||||
views: {
|
views: {
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
|
controller: 'glideraController',
|
||||||
|
controllerAs: 'glidera',
|
||||||
templateUrl: 'views/glidera.html'
|
templateUrl: 'views/glidera.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -679,6 +687,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/buy',
|
url: '/buy',
|
||||||
views: {
|
views: {
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
|
controller: 'buyGlideraController',
|
||||||
|
controllerAs: 'buy',
|
||||||
templateUrl: 'views/buyGlidera.html'
|
templateUrl: 'views/buyGlidera.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -687,6 +697,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/sell',
|
url: '/sell',
|
||||||
views: {
|
views: {
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
|
controller: 'sellGlideraController',
|
||||||
|
controllerAs: 'sell',
|
||||||
templateUrl: 'views/sellGlidera.html'
|
templateUrl: 'views/sellGlidera.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -753,6 +765,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/buy',
|
url: '/buy',
|
||||||
views: {
|
views: {
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
|
controller: 'buyAmazonController',
|
||||||
|
controllerAs: 'buy',
|
||||||
templateUrl: 'views/buyAmazon.html'
|
templateUrl: 'views/buyAmazon.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue