File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,10 +55,18 @@ Environment.prototype.userExit = function(user) {
5555 // Remove user from environment
5656 this . removeUser ( user ) ;
5757
58- // Close the file
59- // then notify other users of departure
60- return Q ( this . pingOthers ( user ) ) ;
58+ var base = Q ( ) ;
59+ if ( this . doc . path != null ) {
60+ // Close the file
61+ base = user . close ( this . doc . path )
62+ }
63+
64+ var that = this ;
6165
66+ // then notify other users of departure
67+ return base . then ( function ( ) {
68+ return that . pingOthers ( user ) ;
69+ } ) ;
6270} ;
6371
6472Environment . prototype . removeUser = function ( user ) {
@@ -144,7 +152,8 @@ Environment.prototype.getSyncData = function() {
144152 return {
145153 content : this . doc . getContent ( ) ,
146154 participants : this . usersInfo ( ) ,
147- state : this . modified
155+ state : this . modified ,
156+ path : this . doc . path
148157 } ;
149158} ;
150159
You can’t perform that action at this time.
0 commit comments