Client - fix distance card refresh
This commit is contained in:
parent
7ca2beded3
commit
d1e36e0614
@ -29,10 +29,10 @@
|
|||||||
|
|
||||||
import StatCard from '@/components/Common/StatCard.vue'
|
import StatCard from '@/components/Common/StatCard.vue'
|
||||||
import { TUnit } from '@/types/units'
|
import { TUnit } from '@/types/units'
|
||||||
import { IUserProfile } from '@/types/user'
|
import { IAuthUserProfile } from '@/types/user'
|
||||||
import { convertDistance, units } from '@/utils/units'
|
import { convertDistance, units } from '@/utils/units'
|
||||||
interface Props {
|
interface Props {
|
||||||
user: IUserProfile
|
user: IAuthUserProfile
|
||||||
}
|
}
|
||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
@ -47,9 +47,11 @@
|
|||||||
const unitTo: TUnit = user.value.imperial_units
|
const unitTo: TUnit = user.value.imperial_units
|
||||||
? units[defaultUnitFrom].defaultTarget
|
? units[defaultUnitFrom].defaultTarget
|
||||||
: defaultUnitFrom
|
: defaultUnitFrom
|
||||||
const totalDistance = user.value.imperial_units
|
const totalDistance: ComputedRef<number> = computed(() =>
|
||||||
|
user.value.imperial_units
|
||||||
? convertDistance(user.value.total_distance, defaultUnitFrom, unitTo, 2)
|
? convertDistance(user.value.total_distance, defaultUnitFrom, unitTo, 2)
|
||||||
: parseFloat(user.value.total_distance.toFixed(2))
|
: parseFloat(user.value.total_distance.toFixed(2))
|
||||||
|
)
|
||||||
|
|
||||||
function get_duration(total_duration: ComputedRef<string>) {
|
function get_duration(total_duration: ComputedRef<string>) {
|
||||||
const duration = total_duration.value.match(/day/g)
|
const duration = total_duration.value.match(/day/g)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user