Skip to content

Commit

Permalink
fix: include check for address type (#4136)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck authored Jun 12, 2024
1 parent 3722529 commit 726e992
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 @@ -354,6 +354,12 @@ export const ListingView = (props: ListingProps) => {
const redirectIfSignedOut = () =>
process.env.showMandatedAccounts && initialStateLoaded && !profile

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

const applySidebar = () => (
<>
<GetApplication
Expand All @@ -379,10 +385,7 @@ export const ListingView = (props: ListingProps) => {
listingId={listing.id}
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 726e992

Please sign in to comment.