Skip to content

Commit 61245a3

Browse files
Maisthojamesdaniels
authored andcommitted
fix(afs): catch error when enabling persistence (#1300)
1 parent 7eb3e51 commit 61245a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/firestore/firestore.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export class AngularFirestore {
100100
constructor(public app: FirebaseApp, shouldEnablePersistence) {
101101
this.firestore = app.firestore();
102102

103-
this.persistenceEnabled$ = shouldEnablePersistence ?
104-
from(app.firestore().enablePersistence().then(() => true)) :
103+
this.persistenceEnabled$ = shouldEnablePersistence ?
104+
from(app.firestore().enablePersistence().then(() => true, () => false)) :
105105
from(new Promise((res, rej) => { res(false); }));
106106
}
107107

0 commit comments

Comments
 (0)