diff --git a/dist/desktop b/dist/desktop index 366b85e16a589746f53ad260a02abdaa346a1212..05c905f9f5cc2cc8698a995e87797991e87e9a26 160000 --- a/dist/desktop +++ b/dist/desktop @@ -1 +1 @@ -Subproject commit 366b85e16a589746f53ad260a02abdaa346a1212 +Subproject commit 05c905f9f5cc2cc8698a995e87797991e87e9a26 diff --git a/www/js/controllers/network-controllers.js b/www/js/controllers/network-controllers.js index 7a718b9359b3f1d9683048981e608c651a912839..2fef96f6bda2f2c23d4f24ef08383ffc03904323 100644 --- a/www/js/controllers/network-controllers.js +++ b/www/js/controllers/network-controllers.js @@ -403,6 +403,8 @@ function NetworkLookupModalController($scope, $controller, parameters) { $scope.enableLocationHref = false; $scope.helptipPrefix = ''; + //$scope.compactMode = false; // Always false, because no toggle button in the modal + $scope.selectPeer = function(peer) { $scope.closeModal(peer); }; diff --git a/www/js/platform.js b/www/js/platform.js index 950d1f6389408012a3cff94f69c99e81bb37d9af..ae21c0b969a49e2ce58b9f4779765ab82352662c 100644 --- a/www/js/platform.js +++ b/www/js/platform.js @@ -100,8 +100,9 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] }) - .factory('csPlatform', function (ionicReady, $rootScope, $q, $state, $translate, $timeout, $ionicHistory, UIUtils, - BMA, Device, csHttp, csConfig, csCache, csSettings, csCurrency, csWallet) { + .factory('csPlatform', function (ionicReady, $rootScope, $q, $state, $translate, $timeout, $ionicHistory, $window, + UIUtils, Modals, BMA, Device, + csHttp, csConfig, csCache, csSettings, csCurrency, csWallet) { 'ngInject'; var @@ -201,6 +202,38 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] }); } + // User can select a node + function selectBmaNode() { + var parameters = { + enableFilter: false, + type: 'all', + bma: true, + expertMode: true + }; + if ($window.location.protocol === 'https:') { + parameters.ssl = true; + } + return Modals.showNetworkLookup(parameters) + .then(function(peer) { + if (!peer) return true; // User cancelled (= keep the default node) + + var node = { + host: peer.getHost(), + port: peer.getPort(), + useSsl: peer.isSsl() + }; + console.info("[platform] Selected peer:", node); + + // Only change BMA node in settings + csSettings.data.node = node; + + // Add a marker, for UI + csSettings.data.node.temporary = true; + + return BMA.copy(node); + }); + } + function isStarted() { return started; } @@ -275,7 +308,9 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] // Load BMA .then(function(){ - return BMA.ready().then(checkBmaNodeAlive); + return BMA.ready() + .then(checkBmaNodeAlive) + .then(selectBmaNode); }) // Load currency