Commit bd78545d by Tuukka Kivilahti

there was a bug, fixed it

1 parent 278d9b8f
Pipeline #52 failed
in 0 seconds
...@@ -9,7 +9,10 @@ const APP_ROUTES: Routes = [ ...@@ -9,7 +9,10 @@ const APP_ROUTES: Routes = [
{ path: 'login', component: LoginComponent }, { path: 'login', component: LoginComponent },
/*{ path: 'viplist', loadChildren: 'app/modules/viplist/viplist.module#ViplistModule' },*/ /*{ path: 'viplist', loadChildren: 'app/modules/viplist/viplist.module#ViplistModule' },*/
{ path: 'viplist', component: InfoViplistPageComponent }, { path: 'viplist', component: InfoViplistPageComponent },
{ path: 'old/info', loadChildren: 'app/modules/old-moya/old-moya.module#OldMoyaModule' }, { path: 'old', loadChildren: 'app/modules/old-moya/old-moya.module#OldMoyaModule' },
{ path: 'user', pathMatch: 'full', component: FrontpageComponent },
{ path: 'info', pathMatch: 'full', component: FrontpageComponent },
{ path: 'admin', pathMatch: 'full', component: FrontpageComponent },
{ path: '', pathMatch: 'full', component: FrontpageComponent } { path: '', pathMatch: 'full', component: FrontpageComponent }
]; ];
......
...@@ -24,7 +24,9 @@ export class MoyaLocaleService { ...@@ -24,7 +24,9 @@ export class MoyaLocaleService {
selectedLocale : string; selectedLocale : string;
constructor(private http: HttpClient, private translate: TranslateService) { constructor(private http: HttpClient, private translate: TranslateService) {
this.translate.setDefaultLang(DEFAULT_LOCALE);
// Falback to be something what everyone can read
this.translate.setDefaultLang(ENGLISH);
this.getUserLocale().subscribe(); this.getUserLocale().subscribe();
} }
...@@ -70,7 +72,9 @@ export class MoyaLocaleService { ...@@ -70,7 +72,9 @@ export class MoyaLocaleService {
} }
return this.http.get<MoyaLocale>(MOYA_BASE_URL + '/v3/locale/') return this.http.get<MoyaLocale>(MOYA_BASE_URL + '/v3/locale/')
.catch(x => Observable.of({} as MoyaLocale)) .catch(x =>
Observable.of({} as MoyaLocale)
)
.map(locale => { .map(locale => {
if (locale && locale.userLocale) { if (locale && locale.userLocale) {
return this.selectLocale(locale.userLocale); return this.selectLocale(locale.userLocale);
......
...@@ -4,10 +4,13 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -4,10 +4,13 @@ import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [ const routes: Routes = [
{ path: '', pathMatch: 'full', component: OldMoyaComponent }, { path: '', pathMatch: 'full', component: OldMoyaComponent },
{ path: 'admin', component: OldMoyaComponent },
{ path: 'info', component: OldMoyaComponent },
{ path: 'user', component: OldMoyaComponent },
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AdminRoutingModule { } export class OldMoyaRoutingModule { }
...@@ -2,11 +2,13 @@ import { PipesModule } from '../../shared/pipes/pipes.module'; ...@@ -2,11 +2,13 @@ import { PipesModule } from '../../shared/pipes/pipes.module';
import { OldMoyaComponent } from './old-moya.component'; import { OldMoyaComponent } from './old-moya.component';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import {OldMoyaRoutingModule} from "./old-moya-routing.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
PipesModule.forRoot() PipesModule.forRoot(),
OldMoyaRoutingModule
], ],
declarations: [OldMoyaComponent], declarations: [OldMoyaComponent],
exports: [OldMoyaComponent] exports: [OldMoyaComponent]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!