Skip to content

Commit

Permalink
Merge pull request #8646 from rtibbles/more_progress
Browse files Browse the repository at this point in the history
Properly fetch more progress for tree data.
  • Loading branch information
marcellamaki authored Nov 10, 2021
2 parents cc3e672 + 732dceb commit df6356d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function useContentNodeProgress() {
* @returns {Promise}
* @public
*/
function fetchContentNodeTreeProgress(id, params) {
function fetchContentNodeTreeProgress({ id, params }) {
return ContentNodeProgressResource.fetchTree({
params,
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function showTopicsTopic(store, { id, pageName }) {
store.getters.isAdmin || store.getters.isCoach || store.getters.isSuperuser,
};
if (store.getters.isUserLoggedIn) {
fetchContentNodeTreeProgress(id, params);
fetchContentNodeTreeProgress({ id, params });
}
return ContentNodeResource.fetchTree({
id,
Expand Down
8 changes: 6 additions & 2 deletions kolibri/plugins/learn/assets/src/modules/topicsTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default {
loadMoreTopics(store) {
const more = store.state.topic.children.more;
if (more) {
fetchContentNodeTreeProgress(more);
if (store.rootGetters.isUserLoggedIn) {
fetchContentNodeTreeProgress(more);
}
return ContentNodeResource.fetchTree(more)
.then(data => {
store.commit('ADD_MORE_CONTENTS', data);
Expand All @@ -58,7 +60,9 @@ export default {
const parent = parentIndex > -1 ? store.state.contents[parentIndex] : null;
const more = parent && parent.children && parent.children.more;
if (more) {
fetchContentNodeTreeProgress(more);
if (store.rootGetters.isUserLoggedIn) {
fetchContentNodeTreeProgress(more);
}
return ContentNodeResource.fetchTree(more)
.then(data => {
data.index = parentIndex;
Expand Down

0 comments on commit df6356d

Please sign in to comment.