diff --git a/frontend/src/pages/GuestView.tsx b/frontend/src/pages/GuestView.tsx index 89f17de..9c22b81 100644 --- a/frontend/src/pages/GuestView.tsx +++ b/frontend/src/pages/GuestView.tsx @@ -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]); diff --git a/frontend/src/pages/HostView.tsx b/frontend/src/pages/HostView.tsx index 5b92c73..d146944 100644 --- a/frontend/src/pages/HostView.tsx +++ b/frontend/src/pages/HostView.tsx @@ -204,7 +204,7 @@ export const HostView = () => { } else { setFilteredOtherLocations(otherLocations.filter(el => el.guestId === clickedId)); } - }, [clickedId]); + }, [clickedId, ws, otherLocations]); return (
@@ -221,7 +221,7 @@ export const HostView = () => { {lat && lng ? ( // eslint-disable-next-line no-nested-ternary mapProps ? ( - otherLocations ? ( + otherLocations && filteredOtherLocations ? (