mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 17:22:45 +00:00
update state when necessary
This commit is contained in:
@@ -113,6 +113,9 @@ const VaultPage = (props)=>{
|
|||||||
const dir = sort && sort.split('/')[1] || 'asc';
|
const dir = sort && sort.split('/')[1] || 'asc';
|
||||||
const pageProp = page || 1;
|
const pageProp = page || 1;
|
||||||
|
|
||||||
|
setSort(sortOption);
|
||||||
|
setdir(dir);
|
||||||
|
|
||||||
performSearch(title, author, count, v3, legacy, pageProp, sortOption, dir);
|
performSearch(title, author, count, v3, legacy, pageProp, sortOption, dir);
|
||||||
|
|
||||||
if(updateTotal)
|
if(updateTotal)
|
||||||
@@ -270,8 +273,6 @@ const VaultPage = (props)=>{
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<button onClick={() => {
|
<button onClick={() => {
|
||||||
setSort(optionValue);
|
|
||||||
setdir(oppositeDir);
|
|
||||||
loadPage(1, false, `${optionValue}/${oppositeDir}`)
|
loadPage(1, false, `${optionValue}/${oppositeDir}`)
|
||||||
}}>
|
}}>
|
||||||
{optionTitle}
|
{optionTitle}
|
||||||
|
|||||||
Reference in New Issue
Block a user