Skip to content

Commit 89d317b

Browse files
authored
fix(@multi-frontend): chargement des traductions avant debut tour guide (#76)
1 parent 1014239 commit 89d317b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

dev/user-frontend-ionic/projects/shared/src/lib/guided-tour/guided-tour.service.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { Capacitor } from '@capacitor/core';
4343
import { OrientationType, ScreenOrientation } from '@capawesome/capacitor-screen-orientation';
4444
import { TranslateService } from '@ngx-translate/core';
4545
import { ShepherdService } from 'angular-shepherd';
46-
import { Observable } from 'rxjs';
46+
import { Observable, zip } from 'rxjs';
4747
import { filter, switchMap, take } from 'rxjs/operators';
4848
import { userIsAuthenticated$ } from '../auth/authenticated-user.repository';
4949
import { MenuItem } from '../navigation/menu.model';
@@ -90,13 +90,14 @@ export class GuidedTourService {
9090
return;
9191
}
9292

93-
this.isOnline$
94-
.pipe(
93+
zip(
94+
this.isOnline$.pipe(
9595
filter(isOnline => isOnline),
9696
take(1),
97-
switchMap(() => userIsAuthenticated$.pipe(take(1)))
98-
)
99-
.subscribe(userIsAuthenticated => {
97+
switchMap(() => userIsAuthenticated$.pipe(take(1))),
98+
),
99+
this.translateService.get('GUIDED_TOUR') // on ne le récupère pas, mais permet d'attendre que la traduction soit chargée, sinon .instant() ne fonctionne pas à chaque fois
100+
).subscribe(([userIsAuthenticated]) => {
100101
if (
101102
!isLoggedTourViewed() &&
102103
!isAnonymousTourViewed() &&

0 commit comments

Comments
 (0)