Store the selected namespace in a persistent cookie, not a session cookie

This commit is contained in:
Joseph Schorr 2013-12-17 14:48:13 -05:00
parent a53106be3b
commit 8725b7a87c

View file

@ -1842,7 +1842,7 @@ quayApp.directive('namespaceSelector', function () {
'namespace': '=namespace',
'requireCreate': '=requireCreate'
},
controller: function($scope, $element, $routeParams, $cookieStore) {
controller: function($scope, $element, $routeParams, $cookies) {
$scope.namespaces = {};
$scope.initialize = function(user) {
@ -1854,7 +1854,7 @@ quayApp.directive('namespaceSelector', function () {
}
}
var initialNamespace = $routeParams['namespace'] || $cookieStore.get('quay.currentnamespace') || $scope.user.username;
var initialNamespace = $routeParams['namespace'] || $cookies.current_namespace|| $scope.user.username;
$scope.namespaces = namespaces;
$scope.setNamespace($scope.namespaces[initialNamespace]);
};
@ -1871,7 +1871,7 @@ quayApp.directive('namespaceSelector', function () {
var newNamespace = namespaceObj.name || namespaceObj.username;
$scope.namespaceObj = namespaceObj;
$scope.namespace = newNamespace;
$cookieStore.put('quay.currentnamespace', newNamespace);
$cookies.current_namespace = newNamespace;
};
$scope.$watch('user', function(user) {