Skip to content

Commit

Permalink
fix: possibility to open messenger for cancelled application (#3069)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Jun 7, 2024
1 parent 86c52e8 commit 4f75c38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Header: React.FC = () => {
isAuthenticated && hasMessenger
? [
<Button
key="open-messenger-button"
variant={unreadMessagesCount ? 'primary' : 'secondary'}
css={`
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ const useHeader = (): ExtendedComponentProps => {
);

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

useEffect(() => {
if (application?.unread_messages_count) {
Expand Down Expand Up @@ -81,6 +84,7 @@ const useHeader = (): ExtendedComponentProps => {
APPLICATION_STATUSES.HANDLING,
APPLICATION_STATUSES.REJECTED,
APPLICATION_STATUSES.ACCEPTED,
APPLICATION_STATUSES.CANCELLED,
].includes(status)
);
}, [status, setHasMessenger]);
Expand Down

0 comments on commit 4f75c38

Please sign in to comment.