fix(front): reset instances list to page 1 if filter or follow status changes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2024-01-04 15:43:02 +01:00
parent 5cb4fc11c4
commit 2b5439b1d0
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -233,7 +233,7 @@ import {
useRouteQuery,
} from "vue-use-route-query";
import { useMutation, useQuery } from "@vue/apollo-composable";
import { computed, inject, ref } from "vue";
import { computed, inject, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { useHead } from "@unhead/vue";
import CloudQuestion from "../../../node_modules/vue-material-design-icons/CloudQuestion.vue";
@ -263,6 +263,10 @@ const { result: instancesResult } = useQuery<{
{ debounce: 500 }
);
watch([filterDomain, followStatus], () => {
instancePage.value = 1;
});
const instances = computed(() => instancesResult.value?.instances);
const { t } = useI18n({ useScope: "global" });