Skip to content
Snippets Groups Projects
Commit ec23fc88 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

Update app init state

parent 85d2f45f
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,6 @@ export class InitApplicationSuccess extends BaseSubAction<InitApplication> {
static readonly type: string = "[App] Init Application Success";
}
export class InitApplicationFail extends BaseSubAction<InitApplication> {
static readonly type: string = "[App] Init Application Fail";
}
export class DefineFallbackLanguage extends BaseAction {
static readonly type: string = "[App] Set Default Language";
}
......
......@@ -7,6 +7,7 @@ import {StateEnum} from "@app/shared/enums/state.enum";
import {UserPreferencesUtil} from "@app/shared/utils/user-preferences.util";
import {
ChangeAppLanguage,
DefineFallbackLanguage,
InitApplication,
InitApplicationFail,
InitApplicationSuccess,
......@@ -14,7 +15,6 @@ import {
LoginFail,
LoginSuccess,
Logout,
DefineFallbackLanguage,
SetMomentLocal,
} from "@app/stores/app.action";
import {TranslateService} from "@ngx-translate/core";
......@@ -62,13 +62,8 @@ export class AppState {
{action: new DefineFallbackLanguage()},
{action: new SetMomentLocal()},
],
).subscribe(success => {
if (success) {
ctx.dispatch(new InitApplicationSuccess(action));
} else {
ctx.dispatch(new InitApplicationFail(action));
}
).subscribe(isAuthenticatedUser => {
ctx.dispatch(new InitApplicationSuccess(action));
});
}
......@@ -79,11 +74,6 @@ export class AppState {
});
}
@Action(InitApplicationFail)
initApplicationFail(ctx: StateContext<AppStateModel>): void {
alert("There is an error during the app initialization !");
}
@Action(DefineFallbackLanguage)
defineFallbackLanguage(ctx: StateContext<AppStateModel>): void {
// this language will be used as a fallback when a translation isn't found in the current language
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment