From 5fd5c2c688309f6aaa8fb8dee68161f5621c1dd6 Mon Sep 17 00:00:00 2001
From: paidge <paidge_cs@hotmail.com>
Date: Sat, 19 Feb 2022 15:42:33 +0100
Subject: [PATCH] correct pagination search when user is not on the first page

---
 components/btn/Pagination.vue | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/components/btn/Pagination.vue b/components/btn/Pagination.vue
index 4a1e3e2..09b6daf 100644
--- a/components/btn/Pagination.vue
+++ b/components/btn/Pagination.vue
@@ -63,7 +63,7 @@ export default {
 	},
 	methods: {
 		goto(i, e) {
-			e.preventDefault()
+			if (e !== undefined) e.preventDefault()
 			this.$emit("update:currentPage", i)
 		},
 		firstPage: function (e) {
@@ -94,6 +94,13 @@ export default {
 
 			return [this.currentPage - 1, this.currentPage, this.currentPage + 1]
 		}
+	},
+	watch: {
+		arrayLength: {
+			handler(n, o) {
+				this.goto(1)
+			}
+		}
 	}
 }
 </script>
-- 
GitLab