Skip to content

Commit

Permalink
adds a check before ancestors are accessed
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOXDi committed Feb 6, 2025
1 parent 89a99e8 commit 406f138
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
</div>

<ResourceSelectionBreadcrumbs
:ancestors="ancestors"
v-if="ancestors.length"
:ancestors="[...ancestors, content]"
:channelsLink="channelsLink"
:topicsLink="topicsLink"
class="align-breadcrumbs"
Expand All @@ -40,7 +41,7 @@
<h5>
<KLabeledIcon :label="content.kind">
<template #icon>
<LearningActivityIcon :kind="content.learning_activities" />
<LearningActivityIcon :kind="learningActivities" />
</template>
<template>
{{ content.title }}
Expand Down Expand Up @@ -147,6 +148,11 @@
type: Boolean,
required: true,
},
questions: {
type: Array,
required: false,
default: () => [],
},
},
data() {
return {
Expand Down Expand Up @@ -182,6 +188,12 @@
return undefined;
},
learningActivities() {
if (this.content.learning_activities) {
return this.content.learning_activities;
}
return [];
},
},
methods: {
topicsLink(topicId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
},
computed: {
isSelected() {
if (this.selectedResources) {
return this.selectedResources.find(resource => resource.id === this.contentId);
if (this.selectedResources && this.contentNode) {
return this.selectedResources.some(resource => resource.id === this.contentNode.id);
}
return false;
},
Expand Down

0 comments on commit 406f138

Please sign in to comment.