Skip to content

Commit

Permalink
make sure hangboard index is set
Browse files Browse the repository at this point in the history
  • Loading branch information
stevie.hartog committed Jun 17, 2024
1 parent d53d863 commit 14c32f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/views/account/AccountHangboardsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion src/views/workouts/WorkoutsDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 14c32f1

Please sign in to comment.