added the descption
All checks were successful
Build frontend / build (push) Successful in 47s

This commit is contained in:
mouazkh
2026-05-26 17:49:39 +03:00
parent 13a0649806
commit 9c79e0648b

View File

@ -228,18 +228,20 @@ export default function PropertyDetailsPage() {
getMySaleListings(),
]);
const myPropIds = new Set();
const addIds = (items) => {
if (!Array.isArray(items)) return;
items.forEach(p => {
const collectIds = (result) => {
if (result.status !== 'fulfilled' || !result.value) return;
const list = Array.isArray(result.value) ? result.value : [result.value];
list.forEach(p => {
const info = p.propertyInformation || {};
if (info.id) myPropIds.add(info.id);
if (p.id) myPropIds.add(p.id);
if (info.id) myPropIds.add(Number(info.id));
if (p.id) myPropIds.add(Number(p.id));
});
};
if (myRent.status === 'fulfilled') addIds(myRent.value);
if (mySale.status === 'fulfilled') addIds(mySale.value);
const propInfoId = mapped._raw?.propertyInformationId || mapped.id;
if (myPropIds.has(propInfoId) || myPropIds.has(mapped.id)) {
collectIds(myRent);
collectIds(mySale);
const checkId = Number(mapped.id) || mapped.id;
const checkInfoId = Number(mapped._raw?.propertyInformation?.id) || mapped._raw?.propertyInformation?.id;
if (myPropIds.has(checkId) || (checkInfoId && myPropIds.has(checkInfoId))) {
setIsOwnProperty(true);
}
} catch {}