Remove sharing ivar from Host Session

This commit is contained in:
Corey Johnson & Matt Colyer
2013-07-23 17:02:19 -07:00
parent 087c4c60a1
commit ce2a613858

View File

@@ -15,7 +15,6 @@ class HostSession
peer: null
mediaConnection: null
doc: null
sharing: false
constructor: ->
@doc = site.createDocument
@@ -51,13 +50,11 @@ class HostSession
@peer.on 'connection', (connection) =>
connection.on 'open', =>
@sharing = true
connection.send({repoSnapshot, doc: @doc.serialize()})
sessionUtils.connectDocument(@doc, connection)
@trigger 'started'
connection.on 'close', =>
@sharing = false
@participants.each (participant, index) =>
if connection.peer is participant.get('id')
@participants.remove(index)
@@ -77,4 +74,4 @@ class HostSession
@peer.id
isSharing: ->
@sharing
@peer? and not _.isEmpty(@peer.connections)