Skip to content

Commit 1dc6765

Browse files
committed
make the useEffect check that the error changes as well so that the POs will load faster
1 parent 18aa081 commit 1dc6765

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pages/requests/[uuid].js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ const Request = () => {
5555
}
5656
}
5757
getPOsAsync()
58-
}, [allPOs]);
58+
}, [allPOs, isPOError]);
5959

6060
console.log(allPOs)
6161
const isLoading = isLoadingRequest || isLoadingSOWs || isLoadingFiles || isLoadingMessages || isPOLoading
6262
const isError = isRequestError || isSOWError || isFilesError|| isMessagesError
63-
const documents = (allSOWs) ? [...allSOWs] : []
63+
let documents = (allSOWs) ? [...allSOWs] : []
64+
allPOs ? (documents = [...documents, ...allPOs]) : (documents = [...documents])
6465

6566
if (isLoading) return <Loading wrapperClass='item-page mt-5' />
6667

0 commit comments

Comments
 (0)