Moves glidera prefs to tab-settings
This commit is contained in:
parent
1669cedd6a
commit
df5fb129a2
6 changed files with 25 additions and 19 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesGlideraController',
|
||||
function($scope, $log, $timeout, $state, ongoingProcess, glideraService, popupService, gettextCatalog) {
|
||||
function($scope, $log, $timeout, $state, $ionicHistory, ongoingProcess, glideraService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.update = function(opts) {
|
||||
if (!$scope.token || !$scope.permissions) return;
|
||||
|
|
@ -41,8 +41,9 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController'
|
|||
popupService.showConfirm('Glidera', 'Are you sure you would like to log out of your Glidera account?', null, null, function(res) {
|
||||
if (res) {
|
||||
glideraService.removeToken(function() {
|
||||
$ionicHistory.clearHistory();
|
||||
$timeout(function() {
|
||||
$state.go('tabs.buyandsell.glidera');
|
||||
$state.go('tabs.home');
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
|
@ -52,14 +53,6 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController'
|
|||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.network = glideraService.getEnvironment();
|
||||
|
||||
$scope.token = null;
|
||||
$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');
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $window, $ionicModal, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService) {
|
||||
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $window, $ionicModal, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService, storageService, glideraService) {
|
||||
|
||||
var updateConfig = function() {
|
||||
|
||||
var config = configService.getSync();
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var isWindowsPhoneApp = platformInfo.isWP && isCordova;
|
||||
|
||||
$scope.usePushNotifications = isCordova && !isWP;
|
||||
$scope.isCordova = isCordova;
|
||||
|
|
@ -25,6 +26,8 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
$scope.wallets = profileService.getWallets();
|
||||
|
||||
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
|
||||
|
||||
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||
};
|
||||
|
||||
$scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) {
|
||||
|
|
@ -35,10 +38,16 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
|||
updateConfig();
|
||||
|
||||
bitpayCardService.getBitpayDebitCards(function(err, data) {
|
||||
if (err) $log.error(err);
|
||||
if (!lodash.isEmpty(data)) {
|
||||
$scope.bitpayCards = true;
|
||||
}
|
||||
});
|
||||
|
||||
storageService.getGlideraToken(glideraService.getEnvironment(), function(err, token) {
|
||||
if (err) $log.error(err);
|
||||
$scope.glideraToken = token;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -877,10 +877,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.buyandsell.glidera.preferences', {
|
||||
url: '/preferences',
|
||||
.state('tabs.preferences.glidera', {
|
||||
url: '/glidera',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesGlideraController',
|
||||
templateUrl: 'views/preferencesGlidera.html'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue