rm go
This commit is contained in:
commit
7d98063c43
12 changed files with 46 additions and 129 deletions
|
|
@ -10,9 +10,9 @@
|
||||||
<ion-content class="has-header" ng-controller="preferencesDeleteWalletController" cache-view="false">
|
<ion-content class="has-header" ng-controller="preferencesDeleteWalletController" cache-view="false">
|
||||||
<div translate>Warning!</div>
|
<div translate>Warning!</div>
|
||||||
<div translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div>
|
<div translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div>
|
||||||
<div class="right" ng-style="{'color':index.backgroundColor}" ng-show="!isDeletingWallet">
|
<div class="right" ng-style="{'color':backgroundColor}" ng-show="!isDeletingWallet">
|
||||||
{{index.walletName}}<span ng-show="index.alias">({{index.alias}})</span>
|
<span ng-show="alias">{{alias}}</span>{{walletName}}
|
||||||
</div>
|
</div>
|
||||||
<button class="button button-block button-stable" ng-click="deleteWallet()"translate>Delete wallet</button>
|
<button class="button button-block button-stable" ng-click="showDeletePopup()"translate>Delete wallet</button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
||||||
|
|
||||||
|
|
||||||
var unitToSatoshi;
|
var unitToSatoshi;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.controllers').controller('coinbaseUriController',
|
angular.module('copayApp.controllers').controller('coinbaseUriController',
|
||||||
function($scope, $stateParams, $timeout, profileService, configService, coinbaseService, storageService, go, ongoingProcess) {
|
function($scope, $stateParams, $timeout, profileService, configService, coinbaseService, storageService, $state, ongoingProcess) {
|
||||||
|
|
||||||
this.submitOauthCode = function(code) {
|
this.submitOauthCode = function(code) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -21,7 +21,7 @@ angular.module('copayApp.controllers').controller('coinbaseUriController',
|
||||||
storageService.setCoinbaseRefreshToken(network, data.refresh_token, function() {
|
storageService.setCoinbaseRefreshToken(network, data.refresh_token, function() {
|
||||||
$scope.$emit('Local/CoinbaseUpdated', data.access_token);
|
$scope.$emit('Local/CoinbaseUpdated', data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
go.path('coinbase');
|
$state.go('coinbase');
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, walletService, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, txStatus, gettext, txFormatService) {
|
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, txStatus, gettext, txFormatService) {
|
||||||
|
|
||||||
var cachedTxp = {};
|
var cachedTxp = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('copayersController',
|
angular.module('copayApp.controllers').controller('copayersController',
|
||||||
function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, $state, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) {
|
function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) {
|
||||||
var self = this;
|
var self = this;
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
var isWP = platformInfo.isWP;
|
var isWP = platformInfo.isWP;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.controllers').controller('glideraUriController',
|
angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
function($scope, $log, $stateParams, $timeout, profileService, configService, glideraService, storageService, go, ongoingProcess) {
|
function($scope, $log, $stateParams, $timeout, profileService, configService, glideraService, storageService, $state, ongoingProcess) {
|
||||||
|
|
||||||
this.submitOauthCode = function(code) {
|
this.submitOauthCode = function(code) {
|
||||||
$log.debug('Glidera Oauth Code:' + code);
|
$log.debug('Glidera Oauth Code:' + code);
|
||||||
|
|
@ -21,7 +21,7 @@ angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
storageService.setGlideraToken(network, data.access_token, function() {
|
storageService.setGlideraToken(network, data.access_token, function() {
|
||||||
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
go.path('glidera');
|
$state.go('glidera');
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
|
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
|
||||||
function($scope, $log, $timeout, configService, rateService, lodash, go, profileService, walletService) {
|
function($scope, $log, $timeout, configService, rateService, lodash, profileService, walletService, $state) {
|
||||||
|
|
||||||
var next = 10;
|
var next = 10;
|
||||||
var completeAlternativeList;
|
var completeAlternativeList;
|
||||||
|
|
@ -42,7 +42,7 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl
|
||||||
|
|
||||||
configService.set(opts, function(err) {
|
configService.set(opts, function(err) {
|
||||||
if (err) $log.warn(err);
|
if (err) $log.warn(err);
|
||||||
go.preferencesGlobal();
|
$state.go('preferencesGlobal');
|
||||||
$scope.$emit('Local/UnitSettingUpdated');
|
$scope.$emit('Local/UnitSettingUpdated');
|
||||||
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
|
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
|
||||||
$log.debug('Remote preferences saved');
|
$log.debug('Remote preferences saved');
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,39 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||||
function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, $state, gettext, gettextCatalog, applicationService, ongoingProcess) {
|
function($scope, $ionicPopup, $stateParams, lodash, notification, profileService, $state, gettextCatalog, ongoingProcess) {
|
||||||
var isCordova = platformInfo.isCordova;
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
$scope.isCordova = isCordova;
|
$scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' ';
|
||||||
|
$scope.walletName = '[' + wallet.credentials.walletName + ']';
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
|
var walletName = $scope.alias || $scope.walletName;
|
||||||
|
|
||||||
var delete_msg = gettextCatalog.getString('Are you sure you want to delete this wallet?');
|
$scope.showDeletePopup = function() {
|
||||||
var accept_msg = gettextCatalog.getString('Accept');
|
var popup = $ionicPopup.show({
|
||||||
var cancel_msg = gettextCatalog.getString('Cancel');
|
template: '<span>' + gettextCatalog.getString('Are you sure you want to delete this wallet?') + '</span>',
|
||||||
var confirm_msg = gettextCatalog.getString('Confirm');
|
title: gettextCatalog.getString('Confirm'),
|
||||||
|
buttons: [
|
||||||
var _modalDeleteWallet = function() {
|
{
|
||||||
$scope.title = delete_msg;
|
text: gettextCatalog.getString('Cancel'),
|
||||||
$scope.accept_msg = accept_msg;
|
onTap: function(e) {
|
||||||
$scope.cancel_msg = cancel_msg;
|
popup.close();
|
||||||
$scope.confirm_msg = confirm_msg;
|
}
|
||||||
$scope.okAction = doDeleteWallet;
|
},
|
||||||
$scope.loading = false;
|
{
|
||||||
|
text: gettextCatalog.getString('Accept'),
|
||||||
$ionicModal.fromTemplateUrl('views/modals/confirmation.html', {
|
type: 'button-positive',
|
||||||
scope: $scope
|
onTap: function(e) {
|
||||||
}).then(function(modal) {
|
deleteWallet();
|
||||||
$scope.confirmationModal = modal;
|
popup.close();
|
||||||
$scope.confirmationModal.show();
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var doDeleteWallet = function() {
|
function deleteWallet() {
|
||||||
ongoingProcess.set('deletingWallet', true);
|
ongoingProcess.set('deletingWallet', true);
|
||||||
var fc = profileService.focusedClient;
|
profileService.deleteWalletClient(wallet, function(err) {
|
||||||
var name = fc.credentials.walletName;
|
|
||||||
var walletName = (fc.alias || '') + ' [' + name + ']';
|
|
||||||
|
|
||||||
profileService.deleteWalletClient(fc, function(err) {
|
|
||||||
ongoingProcess.set('deletingWallet', false);
|
ongoingProcess.set('deletingWallet', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = err.message || err;
|
$scope.error = err.message || err;
|
||||||
|
|
@ -45,20 +45,4 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.deleteWallet = function() {
|
|
||||||
if (isCordova) {
|
|
||||||
navigator.notification.confirm(
|
|
||||||
delete_msg,
|
|
||||||
function(buttonIndex) {
|
|
||||||
if (buttonIndex == 1) {
|
|
||||||
doDeleteWallet();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
confirm_msg, [accept_msg, cancel_msg]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
_modalDeleteWallet();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, go, walletService, profileService) {
|
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, $state, walletService, profileService) {
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
|
|
@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('preferencesUnitController', f
|
||||||
configService.set(opts, function(err) {
|
configService.set(opts, function(err) {
|
||||||
if (err) $log.warn(err);
|
if (err) $log.warn(err);
|
||||||
|
|
||||||
go.preferencesGlobal();
|
$state.go('preferencesGlobal');
|
||||||
$scope.$emit('Local/UnitSettingUpdated');
|
$scope.$emit('Local/UnitSettingUpdated');
|
||||||
|
|
||||||
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
|
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
|
||||||
|
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('sidebarController',
|
|
||||||
function($rootScope, $timeout, $ionicScrollDelegate, lodash, profileService, configService, go, platformInfo, $window) {
|
|
||||||
var self = this;
|
|
||||||
self.isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
|
||||||
self.walletSelection = false;
|
|
||||||
|
|
||||||
self.bitpayCardEnabled = $window.appConfig && $window.appConfig._enabledExtensions.debitcard;
|
|
||||||
|
|
||||||
|
|
||||||
// wallet list change
|
|
||||||
$rootScope.$on('Local/WalletListUpdated', function(event) {
|
|
||||||
self.walletSelection = false;
|
|
||||||
self.setWallets();
|
|
||||||
});
|
|
||||||
|
|
||||||
$rootScope.$on('Local/ColorUpdated', function(event) {
|
|
||||||
self.setWallets();
|
|
||||||
});
|
|
||||||
|
|
||||||
$rootScope.$on('Local/AliasUpdated', function(event) {
|
|
||||||
self.setWallets();
|
|
||||||
});
|
|
||||||
|
|
||||||
self.signout = function() {
|
|
||||||
profileService.signout();
|
|
||||||
};
|
|
||||||
|
|
||||||
self.switchWallet = function(selectedWalletId, currentWalletId) {
|
|
||||||
var client = profileService.focusedClient;
|
|
||||||
if (selectedWalletId == currentWalletId && client.isComplete()) return;
|
|
||||||
self.walletSelection = false;
|
|
||||||
profileService.setAndStoreFocus(selectedWalletId, function() {});
|
|
||||||
$ionicScrollDelegate.scrollTop();
|
|
||||||
};
|
|
||||||
|
|
||||||
self.toggleWalletSelection = function() {
|
|
||||||
self.walletSelection = !self.walletSelection;
|
|
||||||
if (!self.walletSelection) return;
|
|
||||||
self.setWallets();
|
|
||||||
};
|
|
||||||
|
|
||||||
self.setWallets = function() {
|
|
||||||
if (!profileService.profile) return;
|
|
||||||
|
|
||||||
var config = configService.getSync();
|
|
||||||
config.colorFor = config.colorFor || {};
|
|
||||||
config.aliasFor = config.aliasFor || {};
|
|
||||||
|
|
||||||
// Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes)
|
|
||||||
var credentials = lodash.filter(profileService.profile.credentials, 'walletName');
|
|
||||||
var ret = lodash.map(credentials, function(c) {
|
|
||||||
return {
|
|
||||||
m: c.m,
|
|
||||||
n: c.n,
|
|
||||||
name: config.aliasFor[c.walletId] || c.walletName,
|
|
||||||
id: c.walletId,
|
|
||||||
color: config.colorFor[c.walletId] || '#4A90E2',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
self.wallets = lodash.sortBy(ret, 'name');
|
|
||||||
};
|
|
||||||
|
|
||||||
self.setWallets();
|
|
||||||
});
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabScanController', function($scope, $timeout, $ionicModal, $log, $ionicPopup, configService, gettextCatalog, platformInfo, go, bitcore, lodash) {
|
angular.module('copayApp.controllers').controller('tabScanController', function($scope, $timeout, $ionicModal, $log, $ionicPopup, configService, gettextCatalog, platformInfo, bitcore, lodash, $state) {
|
||||||
|
|
||||||
var isCordova = platformInfo.isCordova;
|
var isCordova = platformInfo.isCordova;
|
||||||
var isWP = platformInfo.isWP;
|
var isWP = platformInfo.isWP;
|
||||||
|
|
@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
go.confirm(parsedData);
|
$state.go('confirm', parsedData);
|
||||||
};
|
};
|
||||||
|
|
||||||
var _parseFromUri = function(uri) {
|
var _parseFromUri = function(uri) {
|
||||||
|
|
@ -95,7 +95,7 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
var data = isIOS ? result : result.text;
|
var data = isIOS ? result : result.text;
|
||||||
// Check if the current page is tabs.scan
|
// Check if the current page is tabs.scan
|
||||||
if (go.is('tabs.scan')) {
|
if ($state.is('tabs.scan')) {
|
||||||
_dataScanned(data);
|
_dataScanned(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -190,7 +190,7 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
|
||||||
}
|
}
|
||||||
// Check if the current page is tabs.scan
|
// Check if the current page is tabs.scan
|
||||||
_scanStop();
|
_scanStop();
|
||||||
if (go.is('tabs.scan')) {
|
if ($state.is('tabs.scan')) {
|
||||||
_dataScanned(data);
|
_dataScanned(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, go, walletService) {
|
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService) {
|
||||||
|
|
||||||
var isCordova = platformInfo.isCordova;
|
var isCordova = platformInfo.isCordova;
|
||||||
var isWP = platformInfo.isWP;
|
var isWP = platformInfo.isWP;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue