Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
import FilterTextbox from 'kolibri/components/FilterTextbox';
import PaginationActions from 'kolibri-common/components/PaginationActions';
import { ref, computed, getCurrentInstance, onMounted } from 'vue';
import { ref, computed, getCurrentInstance, onMounted, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router/composables';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
Expand Down Expand Up @@ -279,6 +279,12 @@
fetchClasses();
});
watch([numAppliedFilters, searchTerm], (newValues, oldValues) => {
if (newValues[0] !== oldValues[0] || newValues[1] !== oldValues[1]) {
clearSelectedUsers();
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here looks good to me. However the behavior needs to also apply to the NewUserPage and UsersTrashPage components.

You could look at putting this logic into the useUserManagement.js composable - looks like we have the search and numAppliedFilters and it also houses the list of selectedUsers - so might be able to feed 3 birds with 1 stone since the other user table pages use useUserManagement for these values.

function clearSelectedUsers() {
selectedUsers.value = new Set();
}
Expand Down
Loading