From b8d779a1d0c1993e07d0a2ee5413c67c876a3ee9 Mon Sep 17 00:00:00 2001 From: mouazkh Date: Tue, 26 May 2026 19:25:10 +0300 Subject: [PATCH] added the descption --- app/property/[id]/PropertyDetail.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/app/property/[id]/PropertyDetail.js b/app/property/[id]/PropertyDetail.js index fad636c..ebd59ad 100644 --- a/app/property/[id]/PropertyDetail.js +++ b/app/property/[id]/PropertyDetail.js @@ -226,11 +226,14 @@ export default function PropertyDetailsPage() { try { const myRent = await getMyRentListings(); const list = Array.isArray(myRent) ? myRent : (myRent ? [myRent] : []); - const myPropIds = new Set(list.map(p => { + const myPropIds = new Set(); + list.filter(Boolean).forEach(p => { const info = p.propertyInformation || {}; - return Number(info.id || p.id); - })); - if (myPropIds.has(Number(mapped._raw?.propertyInformation?.id || mapped.id))) { + if (info.id) myPropIds.add(Number(info.id)); + if (p.id) myPropIds.add(Number(p.id)); + }); + const propInfoId = mapped._raw?.propertyInformation?.id; + if (myPropIds.has(Number(mapped.id)) || (propInfoId && myPropIds.has(Number(propInfoId)))) { setIsOwnProperty(true); } } catch (e) { @@ -792,16 +795,6 @@ export default function PropertyDetailsPage() { {/* Sidebar */}
- {/* Debug: Owner Check Info */} - {typeof window !== 'undefined' && ( -
- 🔍 Owner Debug -
-

isOwnProperty: {String(isOwnProperty)}

-

authenticated: {String(AuthService.isAuthenticated())} | isOwner: {String(AuthService.isOwner())}

-
-
- )} {/* Booking Card */} {property.isRent && (