Commit 7faaf2dc authored by Randall Leeds's avatar Randall Leeds

Fix bogus auth form timeout

parent 263a5583
......@@ -52,7 +52,7 @@ class AuthController
$timeout.cancel timeout
# If the model is not empty, start the timeout
if value
if value and not angular.equals(value, {})
timeout = $timeout ->
$scope.model = null
$scope.$broadcast 'timeout'
......
......@@ -84,6 +84,11 @@ describe 'h.auth', ->
assert.calledWith $scope.$broadcast, 'timeout'
it 'should not happen if the model is empty', ->
$scope.model = undefined
$scope.$digest()
assert.notCalled $timeout
$scope.model = {}
$scope.$digest()
assert.notCalled $timeout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment