Skip to content

Commit

Permalink
[OSDEV-1178] Getting "Something went wrong" error after clicking on D…
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimKovalenkoSNF authored Aug 8, 2024
1 parent 4b2d6a5 commit 8881539
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Bugfix
* Ensure that the OpenSearch domain name is unique for each environment to avoid conflicts when provisioning domains across different environments.
* [OSDEV-1176](https://opensupplyhub.atlassian.net/browse/OSDEV-1176) - Fixed a spelling mistake in the label for the password field on the LogIn page. After the fix, the label reads "Password".
* [OSDEV-1178](https://opensupplyhub.atlassian.net/browse/OSDEV-1178) - Fixed error "Something went wrong" error after clicking on Dashboard -> View Facility Claims.

### What's new
* [OSDEV-1144](https://opensupplyhub.atlassian.net/browse/OSDEV-1144) - Claims emails. Updated text for approval, revocation, and denial emails.
Expand Down
26 changes: 13 additions & 13 deletions src/react/src/components/DashboardClaimsListTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,31 +102,31 @@ function DashboardClaimsListTable({
handleSortClaims(sortedData);
};

const wasNotEmptyAndNowEmpty = (prev, current) =>
prev?.current?.length > 0 && current?.length === 0;

useEffect(() => {
/*
Fetch data if prev filters were not empty but
become empty after user click on select field.
This will resolve conflict of when we want to fetch data
when claims or countries filters are removing in UI at the moment
*/
const wasNotEmptyAndNowEmptyClaimStatuses =
prevClaimStatuses &&
prevClaimStatuses.current &&
prevClaimStatuses.current.length > 0 &&
claimStatuses.length === 0;

const wasNotEmptyAndNowEmptyCountriesData =
prevCountriesData &&
prevCountriesData.current &&
prevCountriesData.current.length > 0 &&
countriesData.length === 0;
const wasNotEmptyAndNowEmptyClaimStatuses = wasNotEmptyAndNowEmpty(
prevClaimStatuses,
claimStatuses,
);
const wasNotEmptyAndNowEmptyCountriesData = wasNotEmptyAndNowEmpty(
prevCountriesData,
countriesData,
);

if (isFirstRender.current) {
isFirstRender.current = false;
} else if (
claimStatuses.length > 0 ||
claimStatuses?.length > 0 ||
wasNotEmptyAndNowEmptyClaimStatuses ||
countriesData.length > 0 ||
countriesData?.length > 0 ||
wasNotEmptyAndNowEmptyCountriesData
) {
handleGetClaims();
Expand Down

0 comments on commit 8881539

Please sign in to comment.