File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
src/json-crdt-repo/session Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -118,18 +118,18 @@ export class EditSession<N extends JsonNode = JsonNode<any>> {
118118 this . merge ( < any > res . merge ! ) ;
119119 } ) ;
120120 }
121- // if (res.cursorBehind) {
122- // setTimeout(async () => {
123- // if (! this._stopped) return;
124- // const get = await this.repo.getIf({
125- // id: this.id,
126- // cursor: this.cursor
127- // });
128- // if (! this._stopped) return;
129- // if (!get) return;
130- // this.reset(<any>get.model);
131- // }, 50);
132- // }
121+ if ( res . cursorBehind ) {
122+ setTimeout ( async ( ) => {
123+ if ( this . _stopped ) return ;
124+ const get = await this . repo . getIf ( {
125+ id : this . id ,
126+ cursor : this . cursor
127+ } ) ;
128+ if ( this . _stopped ) return ;
129+ if ( ! get ) return ;
130+ this . reset ( < any > get . model ) ;
131+ } , 50 ) ;
132+ }
133133 return { remote : res . remote } ;
134134 } else {
135135 const res = await this . repo . getIf ( { id : this . id , time : this . model . clock . time - 1 , cursor : this . cursor } ) ;
You can’t perform that action at this time.
0 commit comments