From 2b5439b1d0ef1f60c19019540a01eb6d437eee23 Mon Sep 17 00:00:00 2001
From: Thomas Citharel <tcit@tcit.fr>
Date: Thu, 4 Jan 2024 15:43:02 +0100
Subject: [PATCH] fix(front): reset instances list to page 1 if filter or
 follow status changes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
---
 src/views/Admin/InstancesView.vue | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/views/Admin/InstancesView.vue b/src/views/Admin/InstancesView.vue
index 49a6ceb96..4ef83e150 100644
--- a/src/views/Admin/InstancesView.vue
+++ b/src/views/Admin/InstancesView.vue
@@ -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" });