Skip to content

Commit

Permalink
Switch timeSpent to a prop in LearningActivityBar, and pass from Lear…
Browse files Browse the repository at this point in the history
…nImmersiveLayout
  • Loading branch information
marcellamaki committed Nov 20, 2021
1 parent 340dda5 commit 11f946e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:isQuiz="practiceQuiz"
:showingReportState="currentlyMastered"
:duration="content.duration"
:timeSpent="timeSpent"
:isBookmarked="bookmark ? true : bookmark"
:isCoachContent="isCoachContent"
:contentProgress="contentProgress"
Expand Down Expand Up @@ -199,6 +200,7 @@
error: state => state.core.error,
loading: state => state.core.loading,
blockDoubleClicks: state => state.core.blockDoubleClicks,
timeSpent: state => state.core.logging.time_spent,
}),
...mapState('topicsTree', {
isCoachContent: state => (state.content.coach_content ? 1 : 0),
Expand Down
12 changes: 8 additions & 4 deletions kolibri/plugins/learn/assets/src/views/LearningActivityBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<script>
import difference from 'lodash/difference';
import { mapState } from 'vuex';
import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import CoachContentLabel from 'kolibri.coreVue.components.CoachContentLabel';
import CoreMenu from 'kolibri.coreVue.components.CoreMenu';
Expand Down Expand Up @@ -263,6 +262,14 @@
required: false,
default: null,
},
/**
Actual time spent in seconds
*/
timeSpent: {
type: Number,
required: false,
default: null,
},
},
data() {
return {
Expand All @@ -272,9 +279,6 @@
};
},
computed: {
...mapState({
timeSpent: state => state.core.logging.time_spent,
}),
allActions() {
const actions = [
{
Expand Down

0 comments on commit 11f946e

Please sign in to comment.