diff --git a/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue b/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue index ed14e004..6a9314bb 100644 --- a/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue +++ b/fittrackee_client/src/components/Dashboard/UserStatsCards/index.vue @@ -29,10 +29,10 @@ import StatCard from '@/components/Common/StatCard.vue' import { TUnit } from '@/types/units' - import { IUserProfile } from '@/types/user' + import { IAuthUserProfile } from '@/types/user' import { convertDistance, units } from '@/utils/units' interface Props { - user: IUserProfile + user: IAuthUserProfile } const props = defineProps() @@ -47,9 +47,11 @@ const unitTo: TUnit = user.value.imperial_units ? units[defaultUnitFrom].defaultTarget : defaultUnitFrom - const totalDistance = user.value.imperial_units - ? convertDistance(user.value.total_distance, defaultUnitFrom, unitTo, 2) - : parseFloat(user.value.total_distance.toFixed(2)) + const totalDistance: ComputedRef = computed(() => + user.value.imperial_units + ? convertDistance(user.value.total_distance, defaultUnitFrom, unitTo, 2) + : parseFloat(user.value.total_distance.toFixed(2)) + ) function get_duration(total_duration: ComputedRef) { const duration = total_duration.value.match(/day/g)