Skip to content

Commit

Permalink
fix: chat is open until it's archived for applicant (#3209)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Aug 21, 2024
1 parent 4f138c7 commit 03283ab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frontend/benefit/applicant/src/components/header/useHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ const useHeader = (): ExtendedComponentProps => {
);

const { data: application } = useApplicationQuery(id);
const canWriteNewMessages = !(
application?.has_batch ||
application?.status === APPLICATION_STATUSES.CANCELLED
);

const hasCorrectStatus = ![
APPLICATION_STATUSES.CANCELLED,
APPLICATION_STATUSES.ARCHIVAL,
].includes(application?.status);

const canWriteNewMessages =
hasCorrectStatus && !application?.archived_for_applicant;

useEffect(() => {
if (application?.unread_messages_count) {
Expand Down

0 comments on commit 03283ab

Please sign in to comment.