Skip to content

Commit

Permalink
Merge pull request #390 from boostcampwm-2024/feature/fe/#350-getCurr…
Browse files Browse the repository at this point in the history
…entGuestLocation

[FE][Fix] #350 : [FE][Fix] HostView에서 유저 확인 시 유저의 현재 위치가 감춰지지 않는 문제 해결
  • Loading branch information
happyhyep authored Dec 3, 2024
2 parents ba0ef8c + 4c021e5 commit 937e6ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions frontend/src/pages/GuestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export const GuestView = () => {
console.log('WebSocket connection established');
};

ws.send(
JSON.stringify({
type: 'location',
location: { lat, lng, alpha },
}),
);

wsRef.current = ws;
}, [location]);

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/HostView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const HostView = () => {
} else {
setFilteredOtherLocations(otherLocations.filter(el => el.guestId === clickedId));
}
}, [clickedId]);
}, [clickedId, ws, otherLocations]);

return (
<article className="absolute h-full w-screen flex-grow overflow-hidden">
Expand All @@ -221,7 +221,7 @@ export const HostView = () => {
{lat && lng ? (
// eslint-disable-next-line no-nested-ternary
mapProps ? (
otherLocations ? (
otherLocations && filteredOtherLocations ? (
<MapCanvasForView
lat={lat}
lng={lng}
Expand Down

0 comments on commit 937e6ce

Please sign in to comment.