Skip to content

Commit f39f01b

Browse files
authored
Merge pull request #23 from angular/master
fix(afs): Fix SDK version check (angular#2051)
2 parents 3173b71 + d34bf2f commit f39f01b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/firestore/firestore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export const PersistenceSettingsToken = new InjectionToken<PersistenceSettings|u
1919
export const FirestoreSettingsToken = new InjectionToken<Settings>('angularfire2.firestore.settings');
2020

2121
// timestampsInSnapshots was depreciated in 5.8.0
22-
export const DefaultFirestoreSettings = (parseFloat(SDK_VERSION) < 5.8 ? {timestampsInSnapshots: true} : {}) as Settings;
22+
const major = parseInt(SDK_VERSION.split('.')[0]);
23+
const minor = parseInt(SDK_VERSION.split('.')[1]);
24+
export const DefaultFirestoreSettings = ((major < 5 || (major == 5 && minor < 8)) ? {timestampsInSnapshots: true} : {}) as Settings;
2325

2426
/**
2527
* A utility methods for associating a collection reference with

0 commit comments

Comments
 (0)