Skip to content

Commit 5df31c3

Browse files
jamesdanielsdavideast
authored andcommittedMar 5, 2019
fix(afs): No longer pull in the depreciated timestampsInSnapshots setting for Firebase 5.8 (#2013)
1 parent b91cd5a commit 5df31c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/firestore/firestore.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AngularFirestoreCollection } from './collection/collection';
99
import { FirebaseFirestore, FirebaseOptions, FirebaseAppConfig, FirebaseOptionsToken, FirebaseNameOrConfigToken, _firebaseAppFactory, FirebaseZoneScheduler } from '@angular/fire';
1010
import { isPlatformBrowser } from '@angular/common';
1111

12-
import { firestore } from 'firebase/app';
12+
import { firestore, SDK_VERSION } from 'firebase/app';
1313

1414
/**
1515
* The value of this token determines whether or not the firestore will have persistance enabled
@@ -18,7 +18,8 @@ export const EnablePersistenceToken = new InjectionToken<boolean>('angularfire2.
1818
export const PersistenceSettingsToken = new InjectionToken<PersistenceSettings|undefined>('angularfire2.firestore.persistenceSettings');
1919
export const FirestoreSettingsToken = new InjectionToken<Settings>('angularfire2.firestore.settings');
2020

21-
export const DefaultFirestoreSettings = {timestampsInSnapshots: true} as Settings;
21+
// timestampsInSnapshots was depreciated in 5.8.0
22+
export const DefaultFirestoreSettings = (parseFloat(SDK_VERSION) < 5.8 ? {timestampsInSnapshots: true} : {}) as Settings;
2223

2324
/**
2425
* A utility methods for associating a collection reference with

0 commit comments

Comments
 (0)
Please sign in to comment.