Client - fix distance card refresh
This commit is contained in:
		@@ -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<Props>()
 | 
			
		||||
 | 
			
		||||
@@ -47,9 +47,11 @@
 | 
			
		||||
  const unitTo: TUnit = user.value.imperial_units
 | 
			
		||||
    ? units[defaultUnitFrom].defaultTarget
 | 
			
		||||
    : defaultUnitFrom
 | 
			
		||||
  const totalDistance = user.value.imperial_units
 | 
			
		||||
  const totalDistance: ComputedRef<number> = 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<string>) {
 | 
			
		||||
    const duration = total_duration.value.match(/day/g)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user