Skip to content

Commit

Permalink
Fix miscalled superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbeck committed Feb 15, 2024
1 parent be9186a commit 5c205bd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Model/Doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Doc {
id: string;
model: Model;

constructor(model: Model, collectionName: string, id: string, data: any, _collection?: Collection) {
constructor(model: Model, collectionName: string, id: string, data?: any, _collection?: Collection) {
this.collectionName = collectionName;
this.id = id;
this.data = data;
Expand Down
1 change: 0 additions & 1 deletion src/Model/LocalDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var util = require('../util');
export class LocalDoc extends Doc{
constructor(model: Model, collectionName: string, id: string, data: any) {
super(model, collectionName, id, data);
Doc.call(this, model, collectionName, id);
this._updateCollectionData();
}

Expand Down
4 changes: 1 addition & 3 deletions src/Model/RemoteDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ export class RemoteDoc extends Doc {
shareDoc: any;

constructor(model: Model, collectionName: string, id: string, snapshot: any, collection: Collection) {
super(model, collectionName, id, collection);
super(model, collectionName, id);
// This is a bit messy, but we have to immediately register this doc on the
// collection that added it, so that when we create the shareDoc and the
// connection emits the 'doc' event, we'll find this doc instead of
// creating a new one
if (collection) collection.docs[id] = this;

Doc.call(this, model, collectionName, id);
this.model = model.pass({ $remote: true });
this.debugMutations = model.root.debug.remoteMutations;

Expand Down

0 comments on commit 5c205bd

Please sign in to comment.