From f9d19c75b29aa5494fa652b01ddce55799161eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 21 May 2024 11:57:48 +0200 Subject: [PATCH] change renderPagination order of operations and fix pagination not loading properly --- .../pages/archivePage/archivePage.jsx | 159 ++++++++++-------- 1 file changed, 91 insertions(+), 68 deletions(-) diff --git a/client/homebrew/pages/archivePage/archivePage.jsx b/client/homebrew/pages/archivePage/archivePage.jsx index 6cf84ef3..e23af7b2 100644 --- a/client/homebrew/pages/archivePage/archivePage.jsx +++ b/client/homebrew/pages/archivePage/archivePage.jsx @@ -99,7 +99,9 @@ const ArchivePage = createClass({ if (title !== '') { try { this.setState({ searching: true, error: null }); - const response = await request.get(`/api/archive?title=${title}&page=${page}&size=${size}&v3=${v3}&legacy=${legacy}`); + const response = await request.get( + `/api/archive?title=${title}&page=${page}&size=${size}&v3=${v3}&legacy=${legacy}` + ); if (response.ok) { this.updateStateWithBrews(response.body.brews, page); } @@ -119,6 +121,9 @@ const ArchivePage = createClass({ const { title, v3, legacy } = this.state; if (title !== '') { + this.setState({ + totalBrews: null, + }); try { await request .get( @@ -178,7 +183,10 @@ const ArchivePage = createClass({ placeholder="v3 Reference Document" /> - Tip! you can use - to negate words, and "word" to specify an exact string. + + Tip! you can use - to negate words, and{' '} + "word" to specify an exact string. +