Skip to content

Commit

Permalink
fix(rc): Need to ensureInitialized() (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Jan 21, 2020
1 parent 266f2ec commit 0d95523
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/remote-config/remote-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ export class AngularFireRemoteConfig {
);

const existing$ = loadedRemoteConfig$.pipe(
switchMap(rc => rc.activate().then(() => rc.getAll())),
switchMap(rc =>
rc.activate()
.then(() => rc.ensureInitialized())
.then(() => rc.getAll())
),
filterOutDefaults
);

const fresh$ = loadedRemoteConfig$.pipe(
switchMap(rc => zone.runOutsideAngular(() => rc.fetchAndActivate().then(() => rc.getAll()))),
switchMap(rc => zone.runOutsideAngular(() =>
rc.fetchAndActivate()
.then(() => rc.ensureInitialized())
.then(() => rc.getAll())
)),
filterOutDefaults
);

Expand Down

0 comments on commit 0d95523

Please sign in to comment.