pencil-team 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9262,16 +9262,20 @@ class PenSync {
|
|
|
9262
9262
|
debounceTimer = null;
|
|
9263
9263
|
reconnectTimer = null;
|
|
9264
9264
|
connected = false;
|
|
9265
|
+
initialSyncDone = false;
|
|
9265
9266
|
constructor(options) {
|
|
9266
9267
|
this.options = options;
|
|
9267
9268
|
this.doc = new Doc;
|
|
9268
9269
|
this.awareness = new Awareness(this.doc);
|
|
9269
|
-
this.
|
|
9270
|
-
this.setupFileWatcher();
|
|
9270
|
+
this.initialSyncDone = false;
|
|
9271
9271
|
this.doc.on("update", (update, origin) => {
|
|
9272
|
-
if (origin
|
|
9273
|
-
|
|
9274
|
-
|
|
9272
|
+
if (origin === "remote") {
|
|
9273
|
+
this.writeLocalFile();
|
|
9274
|
+
if (!this.initialSyncDone) {
|
|
9275
|
+
this.initialSyncDone = true;
|
|
9276
|
+
this.setupFileWatcher();
|
|
9277
|
+
}
|
|
9278
|
+
}
|
|
9275
9279
|
});
|
|
9276
9280
|
}
|
|
9277
9281
|
loadLocalFile() {
|