Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bpresles
Cesium
Commits
fe88da95
Commit
fe88da95
authored
6 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Make sure to save settings locally, event if Duniter node is down - fix #788
parent
a4c3ff24
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/js/controllers/settings-controllers.js
+12
-4
12 additions, 4 deletions
www/js/controllers/settings-controllers.js
www/js/services/settings-services.js
+1
-1
1 addition, 1 deletion
www/js/services/settings-services.js
with
13 additions
and
5 deletions
www/js/controllers/settings-controllers.js
+
12
−
4
View file @
fe88da95
...
@@ -84,10 +84,18 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
...
@@ -84,10 +84,18 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
$q
.
all
([
$q
.
all
([
csSettings
.
ready
(),
csSettings
.
ready
(),
csCurrency
.
parameters
()
csCurrency
.
parameters
()
.
then
(
function
(
parameters
)
{
return
parameters
&&
parameters
.
avgGenTime
;
})
// Make sure to continue even if node is down - Fix #788
.
catch
(
function
(
err
)
{
console
.
error
(
"
[settings] Could not not currency parameters. Using default 'avgGenTime' (300)
"
,
err
);
return
{
avgGenTime
:
300
};
})
.
then
(
function
(
parameters
)
{
.
then
(
function
(
parameters
)
{
_
.
each
(
$scope
.
blockValidityWindows
,
function
(
blockCount
)
{
_
.
each
(
$scope
.
blockValidityWindows
,
function
(
blockCount
)
{
if
(
blockCount
>
0
)
{
if
(
blockCount
>
0
)
{
$scope
.
blockValidityWindowLabels
[
blockCount
].
labelParams
.
time
=
parameters
.
avgGenTime
*
blockCount
;
$scope
.
blockValidityWindowLabels
[
blockCount
].
labelParams
.
time
=
parameters
.
avgGenTime
*
blockCount
;
}
}
});
});
})
})
...
@@ -153,7 +161,7 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
...
@@ -153,7 +161,7 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
.
then
(
function
(
newNode
)
{
.
then
(
function
(
newNode
)
{
if
(
newNode
.
host
===
$scope
.
formData
.
node
.
host
&&
if
(
newNode
.
host
===
$scope
.
formData
.
node
.
host
&&
newNode
.
port
===
$scope
.
formData
.
node
.
port
&&
newNode
.
port
===
$scope
.
formData
.
node
.
port
&&
newNode
.
useSsl
===
$scope
.
formData
.
node
.
useSsl
)
{
newNode
.
useSsl
===
$scope
.
formData
.
node
.
useSsl
&&
!
$scope
.
formData
.
node
.
temporary
)
{
return
;
// same node = nothing to do
return
;
// same node = nothing to do
}
}
UIUtils
.
loading
.
show
();
UIUtils
.
loading
.
show
();
...
@@ -169,8 +177,8 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
...
@@ -169,8 +177,8 @@ function SettingsController($scope, $q, $ionicHistory, $ionicPopup, $timeout, $t
});
});
}
}
UIUtils
.
loading
.
hide
();
UIUtils
.
loading
.
hide
();
$scope
.
formData
.
node
=
newNode
;
angular
.
merge
(
$scope
.
formData
.
node
,
newNode
)
;
delete
$scope
.
formData
.
temporary
;
delete
$scope
.
formData
.
node
.
temporary
;
BMA
.
copy
(
nodeBMA
);
BMA
.
copy
(
nodeBMA
);
$scope
.
bma
=
BMA
;
$scope
.
bma
=
BMA
;
...
...
This diff is collapsed.
Click to expand it.
www/js/services/settings-services.js
+
1
−
1
View file @
fe88da95
...
@@ -199,7 +199,7 @@ angular.module('cesium.settings.services', ['ngApi', 'cesium.config'])
...
@@ -199,7 +199,7 @@ angular.module('cesium.settings.services', ['ngApi', 'cesium.config'])
angular
.
merge
(
data
,
newData
);
angular
.
merge
(
data
,
newData
);
// Delete temporary properties, if false
// Delete temporary properties, if false
if
(
!
data
.
node
.
temporary
)
delete
data
.
node
.
temporary
;
if
(
!
newData
.
node
.
temporary
||
!
data
.
node
.
temporary
)
delete
data
.
node
.
temporary
;
// Always force the usage of default settings
// Always force the usage of default settings
// This is a workaround for DEV (TODO: implement edition in settings ?)
// This is a workaround for DEV (TODO: implement edition in settings ?)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment