mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Try to reconnect either on editor-cursor move, or when any thing in the page is clicked.
This commit is contained in:
parent
8bd83f64e0
commit
b4c7209a11
2 changed files with 4 additions and 5 deletions
|
@ -23,7 +23,7 @@ block content
|
|||
.alert.alert-warning.small(ng-if="connection.reconnection_countdown")
|
||||
strong #{translate("lost_connection")}.
|
||||
| #{translate("reconnecting_in_x_secs", {seconds:"{{ connection.reconnection_countdown }}"})}.
|
||||
a.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")}
|
||||
a#try-reconnect-now-button.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")}
|
||||
|
||||
.alert.alert-warning.small(ng-if="connection.reconnecting")
|
||||
strong #{translate("reconnecting")}...
|
||||
|
|
|
@ -19,13 +19,12 @@ define [], () ->
|
|||
@$scope.tryReconnectNow = () =>
|
||||
@tryReconnect()
|
||||
|
||||
@$scope.$on "editor:change", () =>
|
||||
@lastUpdated = new Date()
|
||||
@$scope.$on 'cursor:editor:update', () =>
|
||||
if !@connected
|
||||
@tryReconnect()
|
||||
|
||||
@$scope.$on 'cursor:editor:update', () =>
|
||||
if !@connected
|
||||
document.querySelector('body').addEventListener 'click', (e) =>
|
||||
if !@connected and e.target.id != 'try-reconnect-now-button'
|
||||
@tryReconnect()
|
||||
|
||||
@ide.socket = io.connect null,
|
||||
|
|
Loading…
Reference in a new issue