Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
62905211
Commit
62905211
authored
11 months ago
by
Ina Martini
Browse files
Options
Downloads
Patches
Plain Diff
refactor: remove updateSpeech method
parent
855056dd
No related branches found
Branches containing commit
No related tags found
3 merge requests
!66
Final merge
,
!42
Refactor interactiveSpare to modal
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/HomeView.vue
+17
-24
17 additions, 24 deletions
src/views/HomeView.vue
with
17 additions
and
24 deletions
src/views/HomeView.vue
+
17
−
24
View file @
62905211
...
...
@@ -72,25 +72,18 @@ onMounted(async () => {
firstLoggedInSpeech
()
})
const
updateSpeech
=
(
newSpeech
:
string
[])
=>
{
speech
.
value
=
newSpeech
newSpeechAvailable
.
value
=
true
}
// Check if the user is logging in for the first time, and display the first login speech
const
firstLoggedInSpeech
=
()
=>
{
const
isFirstLogin
=
router
.
currentRoute
.
value
.
query
.
firstLogin
===
'
true
'
if
(
isFirstLogin
)
{
updateSpeech
([
'
Hei, jeg er Spare!
'
,
'
Jeg skal hjelpe deg med å spare penger.
'
,
'
Du får varsel når jeg har noe å si!
'
])
// reset the query parameter
router
.
replace
({
name
:
'
home
'
,
query
:
{
firstLogin
:
'
false
'
}
})
openInteractiveSpare
()
}
const
isFirstLogin
=
router
.
currentRoute
.
value
.
query
.
firstLogin
===
'
true
'
if
(
isFirstLogin
)
{
speech
.
value
=
[
'
Hei, jeg er Spare!
'
,
'
Jeg skal hjelpe deg med å spare penger.
'
,
'
Du får varsel når jeg har noe å si!
'
]
isModalOpen
.
value
=
true
router
.
replace
({
name
:
'
home
'
,
query
:
{
firstLogin
:
'
false
'
}
})
}
}
const
openInteractiveSpare
=
()
=>
{
...
...
@@ -101,13 +94,13 @@ const openInteractiveSpare = () => {
}
}
const
openHelp
=
()
=>
{
updateSpeech
(
[
'
Heisann, jeg er Spare!
'
,
'
Jeg skal hjelpe deg med å spare penger.
'
,
'
Du kan legge til sparemål og spareutfordringer!
'
,
'
Sammen kan vi spare penger og nå dine mål!
'
]
)
openInteractiveSpare
()
speech
.
value
=
[
'
Heisann, jeg er Spare!
'
,
'
Jeg skal hjelpe deg med å spare penger.
'
,
'
Du kan legge til sparemål og spareutfordringer!
'
,
'
Sammen kan vi spare penger og nå dine mål!
'
]
isModalOpen
.
value
=
true
}
</
script
>
...
...
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