Skip to content

Commit

Permalink
Merge pull request #2291 from jadmsaadaot/TRACK-task#2266
Browse files Browse the repository at this point in the history
Fix showing stale status alert for completed works
  • Loading branch information
jadmsaadaot authored May 28, 2024
2 parents 2f27426 + f257aad commit 82f19ee
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { hasPermission } from "components/shared/restricted";
import { ROLES } from "constants/application-constant";

const StatusView = () => {
const { statuses, team } = React.useContext(WorkplanContext);
const { statuses, team, work } = React.useContext(WorkplanContext);
const { setShowStatusForm } = React.useContext(StatusContext);

const { email, roles: currentRoles } = useAppSelector(
Expand All @@ -31,9 +31,9 @@ const StatusView = () => {
setShowStatusForm(true);
};

const statusOutOfDate = isStatusOutOfDate(
statuses.find((status) => status.is_approved)
);
const latestApprovedStatus = statuses.find((status) => status.is_approved);
const statusOutOfDate =
!work?.is_complete && isStatusOutOfDate(latestApprovedStatus);

return (
<>
Expand Down

0 comments on commit 82f19ee

Please sign in to comment.