mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Properly sync resolved comments dropdown to entries
This commit is contained in:
parent
4ee4aa9f0a
commit
a081ae7307
2 changed files with 10 additions and 3 deletions
|
@ -152,6 +152,8 @@ define [
|
|||
rangesTracker = getChangeTracker(doc_id)
|
||||
entries = getDocEntries(doc_id)
|
||||
|
||||
changed = false
|
||||
|
||||
# Assume we'll delete everything until we see it, then we'll remove it from this object
|
||||
delete_changes = {}
|
||||
for change_id, change of entries
|
||||
|
@ -159,6 +161,7 @@ define [
|
|||
delete_changes[change_id] = true
|
||||
|
||||
for change in rangesTracker.changes
|
||||
changed = true
|
||||
delete delete_changes[change.id]
|
||||
entries[change.id] ?= {}
|
||||
|
||||
|
@ -178,6 +181,7 @@ define [
|
|||
refreshChangeUsers(change.metadata.user_id)
|
||||
|
||||
for comment in rangesTracker.comments
|
||||
changed = true
|
||||
delete delete_changes[comment.id]
|
||||
entries[comment.id] ?= {}
|
||||
new_entry = {
|
||||
|
@ -190,8 +194,12 @@ define [
|
|||
entries[comment.id][key] = value
|
||||
|
||||
for change_id, _ of delete_changes
|
||||
changed = true
|
||||
delete entries[change_id]
|
||||
|
||||
if changed
|
||||
$scope.$broadcast "entries:changed"
|
||||
|
||||
$scope.$on "editor:track-changes:changed", () ->
|
||||
doc_id = $scope.editor.open_doc_id
|
||||
updateEntries(doc_id)
|
||||
|
|
|
@ -21,7 +21,6 @@ define [
|
|||
scope.toggleOpenState = () ->
|
||||
scope.state.isOpen = !scope.state.isOpen
|
||||
if (scope.state.isOpen)
|
||||
filterResolvedComments()
|
||||
scope.onOpen()
|
||||
|
||||
scope.resolvedComments = []
|
||||
|
@ -55,4 +54,4 @@ define [
|
|||
|
||||
scope.resolvedComments.push(resolvedComment)
|
||||
|
||||
scope.$watchCollection "resolvedIds", filterResolvedComments
|
||||
scope.$on "entries:changed", filterResolvedComments
|
Loading…
Reference in a new issue