-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I have this issue:
FirebaseError: Expected type 'vh', but it was: a function
Do you have any idea why?
Packages:
"@angular/core": "^15.2.10",
"@angular/fire": "^7.6.1",
"firebase": "^11.5.0",
Here is my code:
```
import { Firestore, disableNetwork, enableNetwork } from '@angular/fire/firestore';
import { Inject, Injectable } from '@angular/core';
[...]
private firestore = Inject(Firestore);
// We should only one enableNetwork() and disableNetwork() call across the app to avoid below issue
// https://github.com/firebase/flutterfire/issues/9986
this.connectionService.monitor().pipe(
mergeMap(state => {
if (state?.hasInternetAccess && state?.hasNetworkConnection) {
return from(enableNetwork(this.firestore)); // Enable network when online
} else {
return from(disableNetwork(this.firestore)); // Disable network when offline
}
})
).subscribe();
Metadata
Metadata
Assignees
Labels
No labels