Remember the state of collapsed/open menus on home tab

This commit is contained in:
Sebastiaan Pasma 2018-05-08 10:28:13 +02:00
commit f945b0f9a7
5 changed files with 39 additions and 7 deletions

View file

@ -1,8 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('nextStepsController', function($scope, nextStepsService, $ionicScrollDelegate, $timeout) {
angular.module('copayApp.controllers').controller('nextStepsController', function($scope, nextStepsService, $ionicScrollDelegate, $timeout, configService) {
$scope.hide = false;
configService.whenAvailable(function(config) {
$scope.hide = config.homeSectionIsHidden&&config.homeSectionIsHidden['nextSteps']?config.homeSectionIsHidden['nextSteps']:false;
});
$scope.services = nextStepsService.get();
$scope.toggle = function() {
@ -10,6 +15,9 @@ angular.module('copayApp.controllers').controller('nextStepsController', functio
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
configService.set({homeSectionIsHidden: {nextSteps: $scope.hide}}, function(err) {
if (err) $log.debug(err);
});
}, 10);
};