mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
on firefox don't show retrying connected message if the user clicked to change page
it creates a bit of worry for the user as it looks like the connection was not there.
This commit is contained in:
parent
a1f57f220b
commit
9eb4dd1b3b
1 changed files with 7 additions and 0 deletions
|
@ -17,6 +17,10 @@ define [], () ->
|
||||||
@disconnectIfInactive()
|
@disconnectIfInactive()
|
||||||
, ONEHOUR)
|
, ONEHOUR)
|
||||||
|
|
||||||
|
@userIsLeavingPage = false
|
||||||
|
window.addEventListener 'beforeunload', =>
|
||||||
|
@userIsLeavingPage = true
|
||||||
|
|
||||||
@connected = false
|
@connected = false
|
||||||
@userIsInactive = false
|
@userIsInactive = false
|
||||||
|
|
||||||
|
@ -122,6 +126,9 @@ define [], () ->
|
||||||
else
|
else
|
||||||
countdown = 3 + Math.floor(Math.random() * 7)
|
countdown = 3 + Math.floor(Math.random() * 7)
|
||||||
|
|
||||||
|
if @userIsLeavingPage #user will have pressed refresh or back etc
|
||||||
|
return
|
||||||
|
|
||||||
@$scope.$apply () =>
|
@$scope.$apply () =>
|
||||||
@$scope.connection.reconnecting = false
|
@$scope.connection.reconnecting = false
|
||||||
@$scope.connection.reconnection_countdown = countdown
|
@$scope.connection.reconnection_countdown = countdown
|
||||||
|
|
Loading…
Reference in a new issue