From 718c65b0a5eeec301793523640cde94c5dd37c39 Mon Sep 17 00:00:00 2001
From: Robin Tissot <tissotrobin@gmail.com>
Date: Tue, 30 Mar 2021 14:57:42 +0200
Subject: [PATCH] Fixes trying to go to invalid page.

---
 front/vue/components/ExtraInfo.vue | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/front/vue/components/ExtraInfo.vue b/front/vue/components/ExtraInfo.vue
index 3fe72bab..9ddbf94d 100644
--- a/front/vue/components/ExtraInfo.vue
+++ b/front/vue/components/ExtraInfo.vue
@@ -50,8 +50,10 @@ export default {
     },
     methods: {
         async goTo(ev) {
-            await this.$store.dispatch('parts/loadPartByOrder', ev.target.value-1);
-            $('#gotoModal').modal('hide');
+            if (ev.target.value > 0 && ev.target.value <= parseInt(ev.target.attributes.max.value)) {
+              await this.$store.dispatch('parts/loadPartByOrder', ev.target.value-1);
+              $('#gotoModal').modal('hide');
+            }
         }
     }
 }
-- 
GitLab