diff --git a/static/js/directives/settings.js b/static/js/directives/settings.js index 504708cc..92b2c504 100644 --- a/static/js/directives/settings.js +++ b/static/js/directives/settings.js @@ -49,7 +49,8 @@ define(['underscore', 'text!partials/settings.html'], function(_, template) { var localStream = null; - $scope.saveSettings = function(user) { + $scope.saveSettings = function() { + var user = $scope.user; $scope.update(user); $scope.layout.settings = false; if ($scope.rememberSettings) { @@ -150,10 +151,8 @@ define(['underscore', 'text!partials/settings.html'], function(_, template) { }; $scope.forgetUserid = function() { - mediaStream.users.forget(); mediaStream.connector.forgetAndReconnect(); - }; $scope.checkDefaultMediaSources = function() { @@ -177,7 +176,7 @@ define(['underscore', 'text!partials/settings.html'], function(_, template) { $scope.mediaSources.refresh(function() { safeApply($scope, $scope.checkDefaultMediaSources); }); - $scope.$watch("layout.settings", function(showSettings) { + $scope.$watch("layout.settings", function(showSettings, oldValue) { if (showSettings) { $scope.desktopNotify.refresh(); $scope.mediaSources.refresh(function(audio, video) { @@ -196,6 +195,8 @@ define(['underscore', 'text!partials/settings.html'], function(_, template) { } }); }); + } else if (!showSettings && oldValue) { + $scope.saveSettings(); } }); }]; diff --git a/static/partials/settings.html b/static/partials/settings.html index c4f71397..a5691973 100644 --- a/static/partials/settings.html +++ b/static/partials/settings.html @@ -144,9 +144,10 @@
{{_('Your ID will still be kept - press the log out button above to delete the ID.')}}