Client - lint fix after Prettier upgrade
This commit is contained in:
parent
34be1885c0
commit
24598453e1
@ -199,12 +199,12 @@
|
||||
// @ts-ignore
|
||||
(appData[key] = getFileSizeInMB(appConfig[key]))
|
||||
: ['about', 'privacy_policy'].includes(key)
|
||||
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
(appData[key] = appConfig[key] !== null ? appConfig[key] : '')
|
||||
: // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
(appData[key] = appConfig[key])
|
||||
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
(appData[key] = appConfig[key] !== null ? appConfig[key] : '')
|
||||
: // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
(appData[key] = appConfig[key])
|
||||
})
|
||||
}
|
||||
function onCancel() {
|
||||
|
@ -98,10 +98,10 @@
|
||||
return fullStats.value && context.chart.chartArea.width < 300
|
||||
? false
|
||||
: displayedData.value === 'average_speed'
|
||||
? displayedSportIds.value.length == 1
|
||||
? 'auto'
|
||||
: false
|
||||
: true
|
||||
? displayedSportIds.value.length == 1
|
||||
? 'auto'
|
||||
: false
|
||||
: true
|
||||
},
|
||||
formatter: function (value, context) {
|
||||
if (displayedData.value === 'average_speed') {
|
||||
|
@ -64,8 +64,8 @@
|
||||
return authUser.value.timezone
|
||||
? authUser.value.timezone
|
||||
: Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
? Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
: 'Europe/Paris'
|
||||
? Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
: 'Europe/Paris'
|
||||
}
|
||||
function getDateFormat() {
|
||||
return dateStringFormats[language.value]
|
||||
|
@ -212,8 +212,8 @@
|
||||
sportPayload.color = sport.color
|
||||
? sport.color
|
||||
: sportColors
|
||||
? sportColors[sport.label]
|
||||
: defaultColor
|
||||
? sportColors[sport.label]
|
||||
: defaultColor
|
||||
sportPayload.is_active = sport.is_active_for_user
|
||||
sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold
|
||||
} else {
|
||||
|
@ -189,12 +189,12 @@
|
||||
return tooltipItems.length === 0
|
||||
? ''
|
||||
: displayDistance.value
|
||||
? `${t('workouts.DISTANCE')}: ${
|
||||
tooltipItems[0].label
|
||||
} ${fromKmUnit}`
|
||||
: `${t('workouts.DURATION')}: ${formatDuration(
|
||||
tooltipItems[0].label.replace(',', '')
|
||||
)}`
|
||||
? `${t('workouts.DISTANCE')}: ${
|
||||
tooltipItems[0].label
|
||||
} ${fromKmUnit}`
|
||||
: `${t('workouts.DURATION')}: ${formatDuration(
|
||||
tooltipItems[0].label.replace(',', '')
|
||||
)}`
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -100,14 +100,14 @@
|
||||
displaySegment && segmentId && segmentId !== 1
|
||||
? `/workouts/${workout.id}/segment/${segmentId - 1}`
|
||||
: !displaySegment && workout.previous_workout
|
||||
? `/workouts/${workout.previous_workout}`
|
||||
: null
|
||||
? `/workouts/${workout.previous_workout}`
|
||||
: null
|
||||
const nextUrl =
|
||||
displaySegment && segmentId && segmentId < workout.segments.length
|
||||
? `/workouts/${workout.id}/segment/${segmentId + 1}`
|
||||
: !displaySegment && workout.next_workout
|
||||
? `/workouts/${workout.next_workout}`
|
||||
: null
|
||||
? `/workouts/${workout.next_workout}`
|
||||
: null
|
||||
return {
|
||||
previousUrl,
|
||||
nextUrl,
|
||||
|
@ -444,14 +444,14 @@
|
||||
workoutForm.workoutAscent === ''
|
||||
? null
|
||||
: authUser.value.imperial_units
|
||||
? convertDistance(+workoutForm.workoutAscent, 'ft', 'm', 3)
|
||||
: +workoutForm.workoutAscent
|
||||
? convertDistance(+workoutForm.workoutAscent, 'ft', 'm', 3)
|
||||
: +workoutForm.workoutAscent
|
||||
payload.descent =
|
||||
workoutForm.workoutDescent === ''
|
||||
? null
|
||||
: authUser.value.imperial_units
|
||||
? convertDistance(+workoutForm.workoutDescent, 'ft', 'm', 3)
|
||||
: +workoutForm.workoutDescent
|
||||
? convertDistance(+workoutForm.workoutDescent, 'ft', 'm', 3)
|
||||
: +workoutForm.workoutDescent
|
||||
if (
|
||||
(payload.ascent !== null && payload.descent === null) ||
|
||||
(payload.ascent === null && payload.descent !== null)
|
||||
|
@ -47,14 +47,14 @@ export const handleError = (
|
||||
const errorMessages = !error
|
||||
? msg
|
||||
: error.response
|
||||
? error.response.status === 413
|
||||
? 'file size is greater than the allowed size'
|
||||
: errorInfo?.message
|
||||
? errorInfo.message
|
||||
: msg
|
||||
: error.message
|
||||
? error.message
|
||||
: msg
|
||||
? error.response.status === 413
|
||||
? 'file size is greater than the allowed size'
|
||||
: errorInfo?.message
|
||||
? errorInfo.message
|
||||
: msg
|
||||
: error.message
|
||||
? error.message
|
||||
: msg
|
||||
context.commit(
|
||||
ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES,
|
||||
errorMessages.includes('\n')
|
||||
|
@ -35,8 +35,8 @@ const sortSports = (a: ITranslatedSport, b: ITranslatedSport): number => {
|
||||
return sportATranslatedLabel > sportBTranslatedLabel
|
||||
? 1
|
||||
: sportATranslatedLabel < sportBTranslatedLabel
|
||||
? -1
|
||||
: 0
|
||||
? -1
|
||||
: 0
|
||||
}
|
||||
|
||||
export const translateSports = (
|
||||
|
@ -174,8 +174,8 @@ export const formatStats = (
|
||||
useImperialUnits
|
||||
)
|
||||
: datasetKey === 'average_speed'
|
||||
? null
|
||||
: 0
|
||||
? null
|
||||
: 0
|
||||
)
|
||||
})
|
||||
})
|
||||
@ -196,14 +196,14 @@ export const getStatsDateParams = (
|
||||
timeFrame === 'year'
|
||||
? startOfYear(subYears(date, 9))
|
||||
: timeFrame === 'week'
|
||||
? startOfWeek(subMonths(date, 2), { weekStartsOn })
|
||||
: startOfMonth(subMonths(date, 11)) // month
|
||||
? startOfWeek(subMonths(date, 2), { weekStartsOn })
|
||||
: startOfMonth(subMonths(date, 11)) // month
|
||||
const end =
|
||||
timeFrame === 'year'
|
||||
? endOfYear(date)
|
||||
: timeFrame === 'week'
|
||||
? endOfWeek(date, { weekStartsOn })
|
||||
: endOfMonth(date) // month
|
||||
? endOfWeek(date, { weekStartsOn })
|
||||
: endOfMonth(date) // month
|
||||
return {
|
||||
duration: timeFrame,
|
||||
end,
|
||||
@ -224,17 +224,17 @@ export const updateChartParams = (
|
||||
duration === 'year'
|
||||
? endOfYear(backward ? subYears(end, 1) : addYears(end, 1))
|
||||
: duration === 'week'
|
||||
? endOfWeek(backward ? subWeeks(end, 1) : addWeeks(end, 1), {
|
||||
weekStartsOn,
|
||||
})
|
||||
: endOfMonth(backward ? subMonths(end, 1) : addMonths(end, 1)),
|
||||
? endOfWeek(backward ? subWeeks(end, 1) : addWeeks(end, 1), {
|
||||
weekStartsOn,
|
||||
})
|
||||
: endOfMonth(backward ? subMonths(end, 1) : addMonths(end, 1)),
|
||||
start:
|
||||
duration === 'year'
|
||||
? startOfYear(backward ? subYears(start, 1) : addYears(start, 1))
|
||||
: duration === 'week'
|
||||
? startOfWeek(backward ? subWeeks(start, 1) : addWeeks(start, 1), {
|
||||
weekStartsOn,
|
||||
})
|
||||
: startOfMonth(backward ? subMonths(start, 1) : addMonths(start, 1)),
|
||||
? startOfWeek(backward ? subWeeks(start, 1) : addWeeks(start, 1), {
|
||||
weekStartsOn,
|
||||
})
|
||||
: startOfMonth(backward ? subMonths(start, 1) : addMonths(start, 1)),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user