Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
4e3d75fe
Commit
4e3d75fe
authored
2 years ago
by
Bastien DUMONT
Committed by
Hugo NOUTS
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore(splash screen): cleanup initialization
parent
b41874f4
No related branches found
No related tags found
2 merge requests
!905
MEP 2.4 : intégration Ma Bulle
,
!895
chore: cleanup initialization
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Splash/SplashRoot.tsx
+1
-2
1 addition, 2 deletions
src/components/Splash/SplashRoot.tsx
src/services/initialization.service.ts
+22
-34
22 additions, 34 deletions
src/services/initialization.service.ts
with
23 additions
and
36 deletions
src/components/Splash/SplashRoot.tsx
+
1
−
2
View file @
4e3d75fe
...
@@ -228,8 +228,7 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => {
...
@@ -228,8 +228,7 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => {
initializationService
.
initChallengeEntity
(
profile
.
explorationHash
),
initializationService
.
initChallengeEntity
(
profile
.
explorationHash
),
initializationService
.
initAnalysis
(
profile
),
initializationService
.
initAnalysis
(
profile
),
])
])
const
updatedProfile
:
Profile
=
{
const
updatedProfile
:
Partial
<
Profile
>
=
{
...
profile
,
duelHash
,
duelHash
,
quizHash
,
quizHash
,
challengeHash
,
challengeHash
,
...
...
This diff is collapsed.
Click to expand it.
src/services/initialization.service.ts
+
22
−
34
View file @
4e3d75fe
...
@@ -657,10 +657,6 @@ export default class InitializationService {
...
@@ -657,10 +657,6 @@ export default class InitializationService {
}
}
public
async
initConsent
():
Promise
<
TermsStatus
>
{
public
async
initConsent
():
Promise
<
TermsStatus
>
{
const
termsStatus
:
TermsStatus
=
{
accepted
:
false
,
versionType
:
'
init
'
,
}
const
startTime
=
performance
.
now
()
const
startTime
=
performance
.
now
()
try
{
try
{
this
.
_setInitStep
(
InitSteps
.
CONSENT
)
this
.
_setInitStep
(
InitSteps
.
CONSENT
)
...
@@ -668,39 +664,31 @@ export default class InitializationService {
...
@@ -668,39 +664,31 @@ export default class InitializationService {
const
isUpToDate
=
await
termService
.
isConsentVersionUpToDate
()
const
isUpToDate
=
await
termService
.
isConsentVersionUpToDate
()
const
lastTerm
=
await
termService
.
getLastTerm
()
const
lastTerm
=
await
termService
.
getLastTerm
()
if
(
lastTerm
)
{
if
(
!
lastTerm
)
{
if
(
isUpToDate
)
{
const
isLastConsentValidated
=
await
termService
.
isLastTermValidated
()
if
(
isLastConsentValidated
)
{
termsStatus
.
accepted
=
true
termsStatus
.
versionType
=
'
init
'
logApp
.
info
(
'
[Initialization] Last Consent successfully loaded and valid
'
)
}
else
{
termsStatus
.
versionType
=
'
init
'
termsStatus
.
accepted
=
false
logApp
.
info
(
'
[Initialization] Consent not up-to-date
'
)
}
}
else
{
const
versionType
=
await
termService
.
getTermsVersionType
()
if
(
versionType
===
'
minor
'
)
{
termsStatus
.
accepted
=
false
termsStatus
.
versionType
=
'
minor
'
logApp
.
info
(
'
[Initialization] Minor Terms update detected
'
)
}
else
{
termsStatus
.
accepted
=
false
termsStatus
.
versionType
=
'
major
'
logApp
.
info
(
'
[Initialization] Major Terms update detected
'
)
}
}
}
else
{
termsStatus
.
accepted
=
false
termsStatus
.
versionType
=
'
init
'
logApp
.
info
(
'
[Initialization] Init first terms
'
)
logApp
.
info
(
'
[Initialization] Init first terms
'
)
return
{
accepted
:
false
,
versionType
:
'
init
'
}
}
if
(
isUpToDate
)
{
const
isLastConsentValidated
=
await
termService
.
isLastTermValidated
()
if
(
isLastConsentValidated
)
{
logApp
.
info
(
'
[Initialization] Last Consent successfully loaded and valid
'
)
return
{
accepted
:
true
,
versionType
:
'
init
'
}
}
logApp
.
info
(
'
[Initialization] Consent not up-to-date
'
)
return
{
accepted
:
false
,
versionType
:
'
init
'
}
}
const
versionType
=
await
termService
.
getTermsVersionType
()
if
(
versionType
===
'
minor
'
)
{
logApp
.
info
(
'
[Initialization] Minor Terms update detected
'
)
return
{
accepted
:
false
,
versionType
:
'
minor
'
}
}
}
return
termsStatus
logApp
.
info
(
'
[Initialization] Major Terms update detected
'
)
return
{
accepted
:
false
,
versionType
:
'
major
'
}
}
catch
(
error
)
{
}
catch
(
error
)
{
this
.
_setInitStepError
(
InitStepsErrors
.
CONSENT_ERROR
)
this
.
_setInitStepError
(
InitStepsErrors
.
CONSENT_ERROR
)
const
errorMessage
=
`Initialization error - initConsent:
${
JSON
.
stringify
(
const
errorMessage
=
`Initialization error - initConsent:
${
JSON
.
stringify
(
...
...
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