Strava refresh token failing + walk activities not properly tagged

[backend] fixed Strava refresh token failing
[backend] fixed walk activities not properly tagged
[frontend]fixed  walk activities not properly tagged
This commit is contained in:
João Vitória Silva
2024-07-31 21:43:14 +01:00
parent 6a4fbc6313
commit 9db7f3d788
3 changed files with 15 additions and 5 deletions

View File

@@ -244,8 +244,9 @@ def define_activity_type(activity_type):
"virtual_ride": 7,
"Swim": 8,
"swimming": 8,
"open_water_swimming": 8,
"Walk": 9,
"open_water_swimming": 9,
"Walk": 11,
"Hike": 12,
}
# "AlpineSki",
# "BackcountrySki",

View File

@@ -32,9 +32,12 @@ def refresh_strava_tokens(db: Session):
# Check if user_integrations strava token is not None
if user_integrations.strava_token is not None:
refresh_time = user_integrations.strava_token_expires_at - timedelta(
minutes=60
)
# refresh_time = user_integrations.strava_token_expires_at - timedelta(
# minutes=60
# )
refresh_time = user_integrations.strava_token_expires_at.replace(
tzinfo=timezone.utc
) - timedelta(minutes=60)
if datetime.now(timezone.utc) > refresh_time:
# Strava token refresh endpoint

View File

@@ -45,6 +45,12 @@
<span v-else-if="activity.activity_type == 8 || activity.activity_type == 9">
<font-awesome-icon :icon="['fas', 'fa-person-swimming']" />
</span>
<span v-else-if="activity.activity_type == 11">
<font-awesome-icon :icon="['fas', 'person-walking']" />
</span>
<span v-else-if="activity.activity_type == 12">
<font-awesome-icon :icon="['fas', 'person-hiking']" />
</span>
<span v-else>
<font-awesome-icon :icon="['fas', 'fa-dumbbell']" />
</span>