-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix - Map not showing full users after clear with large data set #5474
Changes from all commits
a673116
9cffb4f
16812d0
68c6ba8
dd4cc2d
f394bf1
d70e36b
b8fe902
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,9 +81,8 @@ export default function SearchPage({ | |
const isMobile = useMediaQuery(theme.breakpoints.down("md")); | ||
|
||
// State | ||
const [wasSearchPerformed, setWasSearchPerformed] = useState( | ||
locationName !== "" | ||
); | ||
|
||
const [mapPositionFilterActive, setMapPositionFilterActive] = useState(false); | ||
const [locationResult, setLocationResult] = useState<GeocodeResult>({ | ||
bbox: bbox, | ||
isRegion: false, | ||
|
@@ -107,6 +106,7 @@ export default function SearchPage({ | |
>(); | ||
|
||
const [isFiltersOpen, setIsFiltersOpen] = useState(false); | ||
// Filters = mapPosition, locationResult, queryName, lastActive, hostingStatus, numberOfGuest & completeProfile | ||
const [areFiltersCleared, setAreFiltersCleared] = useState( | ||
locationName === "" | ||
); | ||
|
@@ -163,21 +163,22 @@ export default function SearchPage({ | |
completeProfileFilter !== false || | ||
queryName !== "" || | ||
locationResult.name !== "" || | ||
wasSearchPerformed !== false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Just replicated @jesseallhands new issue and checked it out - I think it is happening because this line was removed. If you add a different filter, besides location, and follow the same steps he outlined, the button works as intended and doesn't grey out. Quick note on the "Search here" button - it resets
This makes sense since having both would be contradictory (if you search "Berlin", move to NYC and hit "Search here", you wouldn't want both active). So without the removed line, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm getting confused, isn't |
||
mapPositionFilterActive === true; | ||
// (locationResult.location.lng !== 0 && locationResult.location.lat !== 0); | ||
|
||
if (!wasSearchPerformed && filtersApplied) { | ||
setWasSearchPerformed(true); | ||
} | ||
// if (!wasSearchPerformed) { | ||
// setWasSearchPerformed(true); | ||
// } | ||
|
||
setAreFiltersCleared(!filtersApplied); | ||
}, [ | ||
lastActiveFilter, | ||
hostingStatusFilter, | ||
numberOfGuestFilter, | ||
completeProfileFilter, | ||
wasSearchPerformed, | ||
queryName, | ||
locationResult.name, | ||
mapPositionFilterActive, | ||
]); | ||
|
||
/** | ||
|
@@ -196,8 +197,8 @@ export default function SearchPage({ | |
setHostingStatusFilter([]); | ||
setNumberOfGuestFilter(undefined); | ||
setCompleteProfileFilter(false); | ||
setMapPositionFilterActive(false); | ||
setAreFiltersCleared(true); | ||
setWasSearchPerformed(false); | ||
}; | ||
|
||
const errorMessage = error?.message; | ||
|
@@ -226,7 +227,7 @@ export default function SearchPage({ | |
{/* Mobile */} | ||
{isMobile && ( | ||
<Collapse | ||
in={wasSearchPerformed || !!selectedResult} | ||
in={!!selectedResult} | ||
timeout={theme.transitions.duration.standard} | ||
className={classes.mobileCollapse} | ||
> | ||
|
@@ -271,9 +272,8 @@ export default function SearchPage({ | |
setLocationResult={setLocationResult} | ||
setSelectedResult={setSelectedResult} | ||
isLoading={isLoading || isFetching} | ||
setWasSearchPerformed={setWasSearchPerformed} | ||
wasSearchPerformed={wasSearchPerformed} | ||
areFiltersCleared={areFiltersCleared} | ||
setMapPositionFilterActive={setMapPositionFilterActive} | ||
onClearFiltersClick={handleClearFilters} | ||
/> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this waitFor being added does this have anything to do with the bug fix? Or just a testing issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this was a comment Aapeli made during the meeting that a test was failing on develop after this PR merged, and he sent me this test as the culprit. There's some tests after the React v18 upgrade randomly failing still as they run slower on deployment then locally so we didn't catch them.