Skip to content

Commit

Permalink
fix: Repeated zoomin on same subject
Browse files Browse the repository at this point in the history
Co-authored-by: Didrik Munther <[email protected]>
  • Loading branch information
hampfh and Didrik Munther committed Nov 17, 2024
1 parent 1080795 commit 7796e02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/app/student/map/_components/BoothListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,29 @@ export function BoothListItem({
booth,
onBoothClick,
onBoothNavigate,
currentLocationId,
onMouseEnter,
onMouseLeave,
closeDrawer
}: {
booth: Booth
onBoothClick: (boothId: BoothID) => void
onBoothNavigate: (boothId: BoothID) => void
onBoothNavigate: (boothId: BoothID | null) => void
currentLocationId: LocationId
onMouseEnter: () => void
onMouseLeave: () => void
closeDrawer: () => void
}) {
const logoSrc = booth.exhibitor.logo_squared ?? booth.exhibitor.logo_freesize

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function onBoothMapNavigate(event: any) {
onBoothNavigate(booth.id)
function onBoothMapNavigate() {
/* Sorry to the person that has to read this code
At this point we're on hour 20 of trying to hotfix
the map, we're tired, we want to go home, and there
is no coffe left, I'm starting to question my choices.
But we're here to make the fair great, and great it will be!
*/
onBoothNavigate(null)
setTimeout(() => onBoothNavigate(booth.id))
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/student/map/_components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function Sidebar({
}) {
const { width } = useScreenSize()
const smallScreen = width ? width <= 800 : false
const [open, setOpen] = useState<boolean>(true)
const [open, setOpen] = useState<boolean>(false)
const [showFilters, setShowFilters] = useState(false)

const searchInputRef = useRef<HTMLInputElement>(null)
Expand Down

0 comments on commit 7796e02

Please sign in to comment.