Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DLCM-Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DLCM
UI
DLCM-Portal
Commits
ec23fc88
Commit
ec23fc88
authored
5 years ago
by
Florent Poittevin
Browse files
Options
Downloads
Patches
Plain Diff
Update app init state
parent
85d2f45f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/stores/app.action.ts
+0
-4
0 additions, 4 deletions
src/app/stores/app.action.ts
src/app/stores/app.state.ts
+3
-13
3 additions, 13 deletions
src/app/stores/app.state.ts
with
3 additions
and
17 deletions
src/app/stores/app.action.ts
+
0
−
4
View file @
ec23fc88
...
...
@@ -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
"
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/stores/app.state.ts
+
3
−
13
View file @
ec23fc88
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment