Skip to content
Snippets Groups Projects
Commit d8acfed5 authored by Ina Martini's avatar Ina Martini
Browse files

refactor: remove console logs

parent 10b8a4c5
No related branches found
No related tags found
3 merge requests!66Final merge,!42Refactor interactiveSpare to modal,!4Pipeline fix
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
<div <div
ref="targetRef" ref="targetRef"
class="bg-yellow-400 px-4 py-1 rounded-full text-black font-bold" class="bg-yellow-400 px-4 py-1 rounded-full text-black font-bold"
v-if="goal.saved >= goal.target"
> >
{{ goal.saved }}kr / {{ goal.target }}kr {{ goal.saved }}kr / {{ goal.target }}kr
</div> </div>
...@@ -210,7 +211,6 @@ watch( ...@@ -210,7 +211,6 @@ watch(
(newGoal, oldGoal) => { (newGoal, oldGoal) => {
if (newGoal !== oldGoal) { if (newGoal !== oldGoal) {
goal.value = newGoal goal.value = newGoal
console.log('Updated goal:', goal.value)
} }
}, },
{ immediate: true } { immediate: true }
...@@ -221,7 +221,6 @@ watch( ...@@ -221,7 +221,6 @@ watch(
(newChallenges, oldChallenges) => { (newChallenges, oldChallenges) => {
if (newChallenges !== oldChallenges) { if (newChallenges !== oldChallenges) {
challenges.value = newChallenges challenges.value = newChallenges
console.log('Updated challenges:', challenges.value)
} }
}, },
{ immediate: true } { immediate: true }
...@@ -254,8 +253,6 @@ const incrementSaved = async (challenge: Challenge) => { ...@@ -254,8 +253,6 @@ const incrementSaved = async (challenge: Challenge) => {
challenge.completion = 100 challenge.completion = 100
} }
console.log('Incrementing saved amount for:', challenge)
// Safely update the goal's saved value, ensuring goal.value exists and is not null // Safely update the goal's saved value, ensuring goal.value exists and is not null
if (goal.value) { if (goal.value) {
goal.value.saved = (goal.value.saved || 0) + challenge.perPurchase goal.value.saved = (goal.value.saved || 0) + challenge.perPurchase
...@@ -282,11 +279,11 @@ const recalculateAndAnimate = () => { ...@@ -282,11 +279,11 @@ const recalculateAndAnimate = () => {
} }
const editChallenge = (challenge: Challenge) => { const editChallenge = (challenge: Challenge) => {
router.push(`/spareutfordringer/${challenge.id}`) router.push(`/spareutfordringer/rediger/${challenge.id}`)
} }
const editGoal = (goal: Goal) => { const editGoal = (goal: Goal) => {
router.push(`/sparemaal/${goal.id}`) router.push(`/sparemaal/rediger/${goal.id}`)
} }
// Declare the ref with a type annotation for an array of strings // Declare the ref with a type annotation for an array of strings
...@@ -439,9 +436,8 @@ const getPigStepsIcon = () => { ...@@ -439,9 +436,8 @@ const getPigStepsIcon = () => {
return 'src/assets/pigSteps.png' return 'src/assets/pigSteps.png'
} }
// TODO - Change when EditGoal view is created
const goToEditGoal = () => { const goToEditGoal = () => {
router.push({ name: 'EditGoal' }) router.push({ name: 'edit-goal', params: { id: goal.value?.id } })
} }
</script> </script>
......
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