Skip to content

Commit

Permalink
Changed default load amount
Browse files Browse the repository at this point in the history
  • Loading branch information
euanwm committed Sep 25, 2023
1 parent 5d295e0 commit 83e070d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { LifterChartData } from '@/api/fetchLifterGraphData/fetchLifterGraphData

// I fucking hate this shit
// todo: fix this fucking shit
let maxLifters = 10
const defaultLifters = 10
let maxLifters = 50
const defaultLifterQty = 50

function Home({ data }: { data: LifterResult[] }) {
const [sortBy, setSortBy] = useState('total')
Expand All @@ -33,13 +33,13 @@ function Home({ data }: { data: LifterResult[] }) {

useEffect(() => {
async function callFetchLifterData() {
if (maxLifters != defaultLifters) {
maxLifters = defaultLifters
if (maxLifters != defaultLifterQty) {
maxLifters = defaultLifterQty
}
setCurrentLifterList(
await fetchLifterData(
0,
defaultLifters,
defaultLifterQty,
sortBy,
federation,
weightclass,
Expand Down Expand Up @@ -130,7 +130,8 @@ function Home({ data }: { data: LifterResult[] }) {
className={'flex justify-center'}
aria-label={'Load more results'}
color={'primary'}
onClick={() => updateLifterList((maxLifters += 10))}
onClick={() => updateLifterList((maxLifters += defaultLifterQty))}
isDisabled={currentLifterList.length < maxLifters}
>
Load more results
</Button>
Expand Down

0 comments on commit 83e070d

Please sign in to comment.