From 14c32f1ca7fa4f399937bc8b7943bc124281ac84 Mon Sep 17 00:00:00 2001 From: "stevie.hartog" Date: Mon, 17 Jun 2024 10:55:11 +0000 Subject: [PATCH] make sure hangboard index is set --- src/views/account/AccountHangboardsPage.vue | 2 +- src/views/workouts/WorkoutsDetailPage.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/account/AccountHangboardsPage.vue b/src/views/account/AccountHangboardsPage.vue index 481626b..436d6cb 100644 --- a/src/views/account/AccountHangboardsPage.vue +++ b/src/views/account/AccountHangboardsPage.vue @@ -29,7 +29,7 @@ const { user } = storeToRefs(useAuthenticationStore()) const workouts = useWorkoutsStore() const setHangboard = (index: number) => { - if (user.value) { + if (user.value && index >= 0) { user.value.settings.selected = index updateUser() workouts.workoutsCommunity = [] diff --git a/src/views/workouts/WorkoutsDetailPage.vue b/src/views/workouts/WorkoutsDetailPage.vue index 97fe1a6..0ad2e1f 100644 --- a/src/views/workouts/WorkoutsDetailPage.vue +++ b/src/views/workouts/WorkoutsDetailPage.vue @@ -108,7 +108,7 @@ const missingHangboardDialog = computed(() => { ) if (user.value) { // Ensure that index is defined before setting user settings - if (index !== undefined) { + if (index !== undefined && index !== null && index >= 0) { // eslint-disable-next-line vue/no-side-effects-in-computed-properties user.value.settings.selected = index updateUser()