Skip to content

Commit f7dc54c

Browse files
committed
Fetch LODS only when pageloads
1 parent 43daf97 commit f7dc54c

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

kolibri/plugins/coach/assets/src/views/ClassLearnersListPage.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<template #tbody>
5353
<tbody>
5454
<tr
55-
v-for="learner in learnersWithLearnOnlyDevices"
55+
v-for="learner in learnerMap"
5656
:key="learner.id"
5757
>
5858
<td>
@@ -123,12 +123,6 @@
123123
className() {
124124
return this.$store.state.classSummary.name;
125125
},
126-
learnersWithLearnOnlyDevices() {
127-
const lods = Object.fromEntries(
128-
Object.entries(this.learnerMap).filter(([key]) => key in this.classSyncStatusList),
129-
);
130-
return lods;
131-
},
132126
syncStatusOptions() {
133127
const options = [];
134128
for (const [value] of Object.entries(SyncStatus)) {

kolibri/plugins/coach/assets/src/views/common/ReportsControls.vue

+4-15
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,15 @@
120120
},
121121
},
122122
created() {
123-
this.isPolling = true;
124-
this.pollClassListSyncStatuses();
125-
},
126-
beforeDestroy() {
127-
this.isPolling = false;
123+
this.fetchClassListSyncStatus();
128124
},
129125
methods: {
130126
...mapActions(['fetchUserSyncStatus']),
131-
pollClassListSyncStatuses() {
132-
if (!this.isPolling) {
133-
return;
134-
}
127+
fetchClassListSyncStatus() {
135128
this.fetchUserSyncStatus({ member_of: this.$route.params.classId }).then(data => {
136-
if (!data || !Array.isArray(data)) {
137-
return;
129+
if (Array.isArray(data)) {
130+
this.userSet = new Set(data.map(item => item.user));
138131
}
139-
this.userSet = new Set(data.map(item => item.user));
140-
setTimeout(() => {
141-
this.pollClassListSyncStatuses();
142-
}, '10000');
143132
});
144133
},
145134
},

0 commit comments

Comments
 (0)