Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use total count to check if there's enough contracts #421

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-sheep-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renterd': patch
---

Fixed an issue where the filtered contract count was being used in the onboarding checks.
4 changes: 2 additions & 2 deletions apps/renterd/components/Contracts/ContractsFilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useContracts } from '../../contexts/contracts'
import { ContractsFilterMenu } from './ContractsFilterMenu'

export function ContractsFilterBar() {
const { dataState, offset, limit, datasetCount, pageCount } = useContracts()
const { dataState, offset, limit, datasetFilteredCount, pageCount } = useContracts()

return (
<div className="flex gap-2 w-full">
Expand All @@ -13,7 +13,7 @@ export function ContractsFilterBar() {
isLoading={dataState === 'loading'}
offset={offset}
limit={limit}
datasetTotal={datasetCount}
datasetTotal={datasetFilteredCount}
pageTotal={pageCount}
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion apps/renterd/contexts/contracts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ function useContractsMain() {
isLoading: response.isLoading,
error: response.error,
pageCount: datasetPage?.length || 0,
datasetCount: datasetFiltered?.length || 0,
datasetCount: dataset?.length || 0,
datasetFilteredCount: datasetFiltered?.length || 0,
columns: filteredTableColumns,
dataset,
datasetPage,
Expand Down