Skip to content

Commit

Permalink
fix(FirestoreProvider): return the firestore database instance instea…
Browse files Browse the repository at this point in the history
…d of settings. (#35)

There was a bug introduced with #32 where the result of `firestore().settings(...)` was being returned, causing all `react-firestore` components to break since the result is not the firestore database instance.

Fixes #34
  • Loading branch information
hartym authored and green-arrow committed Nov 21, 2018
1 parent b5e65d3 commit 9b00fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FirestoreProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ export default class FirestoreProvider extends Component {

const { firebase, useTimestampsInSnapshots } = props;
const settings = { timestampsInSnapshots: useTimestampsInSnapshots };
const firestore = firebase.firestore();
firestore.settings(settings);

this.state = {
firestoreDatabase: firebase.firestore().settings(settings),
firestoreDatabase: firestore,
firestoreCache: new FirestoreCache(),
};
}
Expand Down

0 comments on commit 9b00fdf

Please sign in to comment.