Commit 5b488a77 authored by csillag's avatar csillag Committed by Gergely Ujvari

Fix real-time delete

When receiving a real-time notification about the removal
of an annotation, we emit an annotationDeleted event,
so that all components can react.

Earlier, we emited this event simply with the Annotation
bject that arrived on the wire.

However, some components couldn't deal with this, because
they were expecting to see the 'real' Annotation object,
the ones they already knew about.

So now we do a lookup before emiting the event, and use
the locally found objects instead.
parent 620c50b5
......@@ -48,7 +48,8 @@ class AppController
annotationMapper.loadAnnotations data
when 'delete'
for annotation in data
$scope.$emit('annotationDeleted', annotation)
if a = threading.idTable[annotation.id]?.message
$scope.$emit('annotationDeleted', a)
streamer.onmessage = (data) ->
return if !data or data.type != 'annotation-notification'
......
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