Changeset - dcfa69d53fd2
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-30 02:37:41
drewp@bigasterisk.com
don't apply empty patch
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/rdfdbclient.ts
Show inline comments
 
@@ -25,13 +25,20 @@ export class RdfDbClient {
 
      setStatus(st + `; ${this._patchesToSend.length} pending `);
 
    });
 
    this.channel.newConnection.subscribe(() => {
 
      this.clearGraphOnNewConnection();
 
    });
 
    this.channel.serverMessage.subscribe((m) => {
 
      parseJsonPatch(m.body, this.applyPatch.bind(this));
 
      log('got server json', m.body)
 
      parseJsonPatch(m.body, (p: Patch) => {
 
        log('patch from server:', p.dump())
 
        if (p.isEmpty()) {
 
          return;
 
        }
 
        this.applyPatch(p);
 
      });
 
    });
 
  }
 

	
 
  sendPatch(patch: Patch) {
 
    log("queue patch to server ", patch.summary());
 
    this._patchesToSend.push(patch);
0 comments (0 inline, 0 general)