2
0
mirror of synced 2025-02-02 17:43:27 +00:00

[firestore] Bring document change in sync with web sdk

This commit is contained in:
Chris Bianca 2017-10-10 17:48:53 +01:00
parent 469bd318a2
commit a89e741581
2 changed files with 3 additions and 3 deletions

View File

@ -21,8 +21,8 @@ export default class DocumentChange {
_oldIndex: number; _oldIndex: number;
_type: string; _type: string;
constructor(nativeData: DocumentChangeNativeData) { constructor(firestore: Object, nativeData: DocumentChangeNativeData) {
this._document = nativeData.document; this._document = new DocumentSnapshot(firestore, nativeData.document);
this._newIndex = nativeData.newIndex; this._newIndex = nativeData.newIndex;
this._oldIndex = nativeData.oldIndex; this._oldIndex = nativeData.oldIndex;
this._type = nativeData.type; this._type = nativeData.type;

View File

@ -25,7 +25,7 @@ export default class QuerySnapshot {
_query: Query; _query: Query;
constructor(firestore: Object, query: Query, nativeData: QuerySnapshotNativeData) { constructor(firestore: Object, query: Query, nativeData: QuerySnapshotNativeData) {
this._changes = nativeData.changes.map(change => new DocumentChange(change)); this._changes = nativeData.changes.map(change => new DocumentChange(firestore, change));
this._docs = nativeData.documents.map(doc => new DocumentSnapshot(firestore, doc)); this._docs = nativeData.documents.map(doc => new DocumentSnapshot(firestore, doc));
this._metadata = nativeData.metadata; this._metadata = nativeData.metadata;
this._query = query; this._query = query;