mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
remove underscore from pollSavingStatus
the underscore module is not loading in time for some users on MacOS
This commit is contained in:
parent
adb98d05b5
commit
6320fcccec
1 changed files with 8 additions and 2 deletions
|
@ -13,11 +13,14 @@ define [
|
||||||
$scope.docSavingStatus = {}
|
$scope.docSavingStatus = {}
|
||||||
pollSavedStatus = () ->
|
pollSavedStatus = () ->
|
||||||
oldStatus = $scope.docSavingStatus
|
oldStatus = $scope.docSavingStatus
|
||||||
|
oldUnsavedCount = $scope.docSavingStatusCount
|
||||||
newStatus = {}
|
newStatus = {}
|
||||||
|
newUnsavedCount = 0
|
||||||
|
|
||||||
for doc_id, doc of Document.openDocs
|
for doc_id, doc of Document.openDocs
|
||||||
saving = doc.pollSavedStatus()
|
saving = doc.pollSavedStatus()
|
||||||
if !saving
|
if !saving
|
||||||
|
newUnsavedCount++
|
||||||
if oldStatus[doc_id]?
|
if oldStatus[doc_id]?
|
||||||
newStatus[doc_id] = oldStatus[doc_id]
|
newStatus[doc_id] = oldStatus[doc_id]
|
||||||
newStatus[doc_id].unsavedSeconds += 1
|
newStatus[doc_id].unsavedSeconds += 1
|
||||||
|
@ -28,9 +31,12 @@ define [
|
||||||
}
|
}
|
||||||
|
|
||||||
# for performance, only update the display if the old or new
|
# for performance, only update the display if the old or new
|
||||||
# statuses have any unsaved files
|
# counts of unsaved files are nonzeror. If both old and new
|
||||||
if _.size(newStatus) or _.size(oldStatus)
|
# unsaved counts are zero then we know we are in a good state
|
||||||
|
# and don't need to do anything to the UI.
|
||||||
|
if newUnsavedCount or oldUnsavedCount
|
||||||
$scope.docSavingStatus = newStatus
|
$scope.docSavingStatus = newStatus
|
||||||
|
$scope.docSavingStatusCount = newUnsavedCount
|
||||||
$scope.$apply()
|
$scope.$apply()
|
||||||
|
|
||||||
warnAboutUnsavedChanges = () ->
|
warnAboutUnsavedChanges = () ->
|
||||||
|
|
Loading…
Reference in a new issue