Skip to content

Commit

Permalink
FIX bug chargement de page n
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdelafontaine committed Dec 20, 2024
1 parent 912d65e commit 7b1dd92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/common/results/SortingSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const { setSorting, getItemsTri, getCurrentSorting, getTriMap } = useStrategyAPI
const items = ref([]);
const tri = ref("");
let triIsInitialized = false;
let noDoubleUpdates = false;
onMounted(() => {
Expand Down Expand Up @@ -83,10 +84,12 @@ function getCurrentSortName() {
// Surveiller les changements de tri
watch(tri, async (newSortingArray, previousSortingArray) => {
if (typeof previousSortingArray !== 'undefined' && !noDoubleUpdates) {
if (typeof previousSortingArray !== 'undefined' && !noDoubleUpdates && triIsInitialized) {
setSorting(newSortingArray.cle);
emit("updatePageNumberFromSortingSelect", 1);
emit("search");
} else {
triIsInitialized = true;
}
noDoubleUpdates = false;
});
Expand Down
2 changes: 1 addition & 1 deletion composables/useStrategyAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default function() {
if (domaine.value === "personnes")
return queryPersonnesAPI(replaceAndEscape(query.value), getFacetsRequest(), currentPageNumber.value, currentShowingNumber.value, currentSorting.value);
else
//La recherche avancée ne doit pas échapper les caractères spécieaux, on passe isAdvanced pour déterminer quels caractères échapper
//La recherche avancée ne doit pas échapper les caractères spéciaux, on passe isAdvanced pour déterminer quels caractères échapper
return queryThesesAPI(replaceAndEscape(query.value, isAdvanced.value), getFacetsRequest(), currentPageNumber.value, currentShowingNumber.value, currentSorting.value);
}

Expand Down

0 comments on commit 7b1dd92

Please sign in to comment.