Skip to content

Commit

Permalink
Revert "Front - Panier - WIP - Change le realtime de supabase par web…
Browse files Browse the repository at this point in the history
…socket"

This reverts commit 16d680b.
  • Loading branch information
amandinejacquelin committed Oct 10, 2024
1 parent 2cf7d46 commit 78a7c06
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/panier/components/PanierRealtime/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,9 @@ const PanierRealtime = ({
}, [panier.collectivite_preset, setCollectiviteId]);

useEffect(() => {
const socket: Socket = io('http://localhost:3000');
socket.on('panierUpdate', (panierId) => {
if (panierId === panier.id) {
router.refresh();
}
});
const channel = panierAPI.listenToPanierUpdates(panier.id, router.refresh);
return () => {
socket.disconnect();
supabase.removeChannel(channel);
};
}, [router, panier.id, setUser]);

Expand Down

0 comments on commit 78a7c06

Please sign in to comment.