Skip to content

Commit fca5859

Browse files
Workaround for #13 point.data error GeoPoint is not a constructor.
The location of the GeoPoint constructor was moved in some versions of firebase/firestore. A better check might check the appropriate SDK Version of firebase here? resolves #13
1 parent 25a06a9 commit fca5859

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@ export class GeoFireClient {
3131
* @returns GeoFireClient
3232
*/
3333
export function init(app: firestore.FirebaseApp): GeoFireClient {
34+
// Bug Fix for #13 Geopoint was moved from app.firestore to app._firebase_.firestore.GeoPoint?
35+
if (typeof(app.firestore.GeoPoint) === 'undefined' && app.firebase_ && app.firebase_.firestore && app.firebase_.firestore.GeoPoint) {
36+
app.firestore.GeoPoint = app.firebase_.firestore.GeoPoint;
37+
}
3438
return new GeoFireClient(app);
3539
}

0 commit comments

Comments
 (0)