diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index d853f11eb..2deb71fd1 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -34,7 +34,7 @@ const VaultPage = (props) => { useEffect(() => { disableSubmitIfFormInvalid(); - loadPage(pageState, false, true); + loadPage(pageState, true); }, []); const updateStateWithBrews = (brews, page) => { @@ -96,7 +96,7 @@ const VaultPage = (props) => { } }; - const loadPage = async (page, update, total) => { + const loadPage = async (page, updateTotal) => { if (!validateForm()) { return; } @@ -112,9 +112,8 @@ const VaultPage = (props) => { // Perform search with the latest input values, because state is not fast enough performSearch({ titleValue, authorValue, countValue, v3Value, legacyValue, page }); - if (total) { + if (updateTotal) loadTotal({ titleValue, authorValue, v3Value, legacyValue }); - } }; const renderNavItems = () => ( @@ -165,7 +164,7 @@ const VaultPage = (props) => { title="At least 3 characters" onKeyDown={(e) => { if (e.key === 'Enter' && !submitButtonRef.current.disabled) - loadPage(1, true, true); + loadPage(1, true); }} placeholder="v3 Reference Document" /> @@ -182,7 +181,7 @@ const VaultPage = (props) => { onKeyUp={disableSubmitIfFormInvalid} onKeyDown={(e) => { if (e.key === 'Enter' && !submitButtonRef.current.disabled) - loadPage(1, true, true); + loadPage(1, true); }} placeholder="Username" /> @@ -224,7 +223,7 @@ const VaultPage = (props) => { id="searchButton" ref={submitButtonRef} onClick={() => { - loadPage(1, true, true); + loadPage(1, true); }} > Search @@ -287,7 +286,7 @@ const VaultPage = (props) => { className={`pageNumber ${ pageState === startPage + index ? 'currentPage' : '' }`} - onClick={() => loadPage(startPage + index, false, false)} + onClick={() => loadPage(startPage + index, false)} > {startPage + index} @@ -297,7 +296,7 @@ const VaultPage = (props) => {