Skip to content

Commit

Permalink
fix: include check for address type (bloom-housing#4136) (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck authored Jun 12, 2024
1 parent fd86ea1 commit 089ea02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sites/public/src/components/listing/ListingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ export const ListingView = (props: ListingProps) => {
!props.isExternal &&
!props.preview

const submissionAddressExists =
listing.listingsApplicationMailingAddress ||
listing.applicationMailingAddressType === ApplicationAddressTypeEnum.leasingAgent ||
listing.listingsApplicationDropOffAddress ||
listing.applicationDropOffAddressType === ApplicationAddressTypeEnum.leasingAgent

const applySidebar = () => (
<>
<GetApplication
Expand All @@ -407,10 +413,7 @@ export const ListingView = (props: ListingProps) => {
isExternal={props.isExternal}
listingStatus={listing.status}
/>
{!(
listing.status === ListingsStatusEnum.closed ||
!(listing.listingsApplicationMailingAddress || listing.listingsApplicationDropOffAddress)
) && (
{listing.status !== ListingsStatusEnum.closed && submissionAddressExists && (
<SubmitApplication
applicationMailingAddress={getAddress(listing.applicationMailingAddressType, "mailIn")}
applicationDropOffAddress={getAddress(listing.applicationDropOffAddressType, "dropOff")}
Expand Down

0 comments on commit 089ea02

Please sign in to comment.