@@ -38,7 +38,8 @@ angular.module('cesium.es.settings.controllers', ['cesium.es.services'])
3838/*
3939 * Settings extend controller
4040 */
41- function ESExtendSettingsController ( $scope , Wallet , PluginService , APP_CONFIG ) {
41+ function ESExtendSettingsController ( $scope , $rootScope , Wallet , PluginService , APP_CONFIG ) {
42+ 'ngInject' ;
4243
4344 $scope . extensionPoint = PluginService . extensions . points . current . get ( ) ;
4445 $scope . enable = false ;
@@ -59,20 +60,27 @@ function ESExtendSettingsController ($scope, Wallet, PluginService, APP_CONFIG)
5960/*
6061 * Settings extend controller
6162 */
62- function ESPluginSettingsController ( $scope , $q , $translate , $ionicPopup , $ionicHistory , UIUtils , APP_CONFIG , esHttp , esMarket ,
63+ function ESPluginSettingsController ( $scope , $rootScope , $ q, $translate , $ionicPopup , $ionicHistory , UIUtils , APP_CONFIG , esHttp , esMarket ,
6364 esRegistry , esUser , Wallet ) {
65+ 'ngInject' ;
6466
6567 $scope . formData = { } ;
68+ $scope . loading = true ;
6669
6770 $scope . $on ( '$ionicView.enter' , function ( e , $state ) {
68- if ( ! $scope . formData . node && APP_CONFIG . DUNITER_NODE_ES ) {
71+ if ( ! $scope . formData . node ) {
6972 if ( Wallet . data . settings && Wallet . data . settings . plugins && Wallet . data . settings . plugins . es ) {
7073 angular . merge ( $scope . formData , Wallet . data . settings . plugins . es ) ;
7174 }
7275 else {
7376 $scope . formData . enable = ! ! APP_CONFIG . DUNITER_NODE_ES ;
77+
78+ }
79+ if ( ! $scope . formData . node ) {
80+ $scope . formData . node = APP_CONFIG . DUNITER_NODE_ES ;
7481 }
7582 }
83+ $scope . loading = false ;
7684 } ) ;
7785
7886 $scope . setSettingsForm = function ( settingsForm ) {
@@ -155,11 +163,9 @@ function ESPluginSettingsController ($scope, $q, $translate, $ionicPopup, $ioni
155163
156164 $scope . onSettingsChanged = function ( ) {
157165 if ( $scope . loading ) {
158- $timeout ( function ( ) {
159- $scope . onSettingsChanged ( ) ;
160- } , 200 ) ;
161166 return ;
162167 }
168+
163169 $scope . loading = true ;
164170
165171 if ( ! Wallet . data . settings . plugins ) {
@@ -176,7 +182,7 @@ function ESPluginSettingsController ($scope, $q, $translate, $ionicPopup, $ioni
176182 esHttp . setEnable ( $scope . formData . enable ) ;
177183 esUser . refreshListeners ( ) ;
178184
179- Wallet . store ( ) ;
185+ Wallet . store ( { settings : true , data : false } ) ;
180186
181187 // Clean cache
182188 $ionicHistory . clearCache ( ) ;
0 commit comments