Client - minor fixes
This commit is contained in:
parent
59940ed41d
commit
9ed142e100
@ -66,7 +66,7 @@
|
||||
function getQuery(
|
||||
page: number,
|
||||
cursor?: number
|
||||
): TWorkoutsPayload | TPaginationPayload {
|
||||
): TPaginationPayload | IOauth2ClientsPayload {
|
||||
const newQuery = Object.assign({}, query.value)
|
||||
newQuery.page = cursor ? page + cursor : page
|
||||
return newQuery
|
||||
|
@ -28,13 +28,13 @@
|
||||
import SportsMenu from '@/components/Statistics/StatsSportsMenu.vue'
|
||||
import { ISport, ITranslatedSport } from '@/types/sports'
|
||||
import { IStatisticsDateParams } from '@/types/statistics'
|
||||
import { IUserProfile } from '@/types/user'
|
||||
import { IAuthUserProfile } from '@/types/user'
|
||||
import { translateSports } from '@/utils/sports'
|
||||
import { getStatsDateParams, updateChartParams } from '@/utils/statistics'
|
||||
|
||||
interface Props {
|
||||
sports: ISport[]
|
||||
user: IUserProfile
|
||||
user: IAuthUserProfile
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
|
@ -184,7 +184,8 @@
|
||||
const { t } = useI18n()
|
||||
|
||||
const { isEdition, user } = toRefs(props)
|
||||
const sportColors = inject('sportColors')
|
||||
const defaultColor = '#838383'
|
||||
const sportColors: Record<string, string> | undefined = inject('sportColors')
|
||||
const sports: ComputedRef<ISport[]> = computed(
|
||||
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
|
||||
)
|
||||
@ -207,7 +208,11 @@
|
||||
function updateSportInEdition(sport: ISport | null) {
|
||||
if (sport !== null) {
|
||||
sportPayload.sport_id = sport.id
|
||||
sportPayload.color = sport.color ? sport.color : sportColors[sport.label]
|
||||
sportPayload.color = sport.color
|
||||
? sport.color
|
||||
: sportColors
|
||||
? sportColors[sport.label]
|
||||
: defaultColor
|
||||
sportPayload.is_active = sport.is_active_for_user
|
||||
sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold
|
||||
} else {
|
||||
|
@ -18,6 +18,7 @@ export interface IUserProfile {
|
||||
picture: string | boolean
|
||||
records: IRecord[]
|
||||
sports_list: number[]
|
||||
total_ascent: number
|
||||
total_distance: number
|
||||
total_duration: string
|
||||
username: string
|
||||
|
Loading…
Reference in New Issue
Block a user