robisim74 / angular-l10n

Angular library to translate texts, dates and numbers
MIT License
380 stars 59 forks source link

Opening subpages in tabs works - sometimes #341

Closed stefan-schilling closed 1 year ago

stefan-schilling commented 1 year ago

Describe the bug Using version 14.0.0 with Angular 14.

Being our main page /dashboard (or here: /en/dashboard), I open sub pages in tabs. Sometimes, this works seemlessly. But more often, I get redirected to /en/dashboard again. Avoiding to use tabs helps - all pages get loaded as expected. Note: /en/dashboard is our error fallback, but I've checked remote requests: they were all successful.

To Reproduce Steps to reproduce the behavior:

  1. Go to main page /en/dashboard
  2. Open another page in a tab
  3. Sometimes, opening the page works as expected - but often not, since the tab starts loading but then gets redirected to /en/dashboard again

Expected behavior Should be irrelevant, if the page is loading in a tab or not.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Our app routings: ` const routes: Routes = [ { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, { path: 'dashboard', loadChildren: () => LandingModule }, { path: ':market/dashboard', loadChildren: () => LandingModule }, ...errorRoute, { path: '**', redirectTo: '/dashboard' } ];

@NgModule({ imports: [RouterModule.forRoot(routes, {preloadingStrategy: AppCustomPreloader})], exports: [RouterModule], providers: [AppCustomPreloader] }) export class AppRoutingModule {} `

Relevant part of app.module:

@NgModule({ declarations: [AppComponent], imports: [ AppRoutingModule, HttpClientModule, L10nTranslationModule.forRoot( l10nConfig, { translationLoader: TranslationLoader } ), L10nValidationModule.forRoot(), L10nRoutingModule.forRoot() ], providers: [ StartupService, { provide: APP_INITIALIZER, useFactory: initL10n, deps: [L10nLoader], multi: true }, ], bootstrap: [AppComponent] }) export class AppModule { } (sorry for the formatting)

robisim74 commented 1 year ago

I think this request is a duplicate of #340