Skip to content

Commit

Permalink
fix(service-portal): Filter for unread. Loading state for total page …
Browse files Browse the repository at this point in the history
…count (#15090)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
thordurhhh and kodiakhq[bot] authored Jun 4, 2024
1 parent 427d86d commit 8bdf391
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DocumentsClientV2Service {
): T {
const sanitizedObj = {} as T
for (const key in obj) {
if (obj[key]) {
if (obj[key] || key === 'opened') {
sanitizedObj[key] = obj[key]
}
}
Expand Down
4 changes: 2 additions & 2 deletions libs/service-portal/documents/src/hooks/useDocumentList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ export const useDocumentList = () => {
const totalCount = data?.documentsV2?.totalCount || 0
useEffect(() => {
const pageCount = Math.ceil(totalCount / pageSize)
if (pageCount !== totalPages && pageCount !== 0) {
if (pageCount !== totalPages && !loading) {
setTotalPages(pageCount)
}
}, [pageSize, totalCount])
}, [pageSize, totalCount, loading])

const filteredDocuments = data?.documentsV2?.data || []
const activeArchive = filterValue.archived === true
Expand Down

0 comments on commit 8bdf391

Please sign in to comment.