Skip to content

Commit 0d95523

Browse files
authored
fix(rc): Need to ensureInitialized() (#2290)
1 parent 266f2ec commit 0d95523

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: src/remote-config/remote-config.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,20 @@ export class AngularFireRemoteConfig {
108108
);
109109

110110
const existing$ = loadedRemoteConfig$.pipe(
111-
switchMap(rc => rc.activate().then(() => rc.getAll())),
111+
switchMap(rc =>
112+
rc.activate()
113+
.then(() => rc.ensureInitialized())
114+
.then(() => rc.getAll())
115+
),
112116
filterOutDefaults
113117
);
114118

115119
const fresh$ = loadedRemoteConfig$.pipe(
116-
switchMap(rc => zone.runOutsideAngular(() => rc.fetchAndActivate().then(() => rc.getAll()))),
120+
switchMap(rc => zone.runOutsideAngular(() =>
121+
rc.fetchAndActivate()
122+
.then(() => rc.ensureInitialized())
123+
.then(() => rc.getAll())
124+
)),
117125
filterOutDefaults
118126
);
119127

0 commit comments

Comments
 (0)