diff --git a/client/src/app.tsx b/client/src/app.tsx index a81e3d5..58eb9ee 100644 --- a/client/src/app.tsx +++ b/client/src/app.tsx @@ -33,6 +33,8 @@ const Main = () => { const { ws } = store.getState(); if (!ws) return null; if (e.url === '/acp') return ws.sendAcpOffers(); + if (e.url === '/') return ws.sendOffers(); + if (e.url === '/list') return ws.sendWants(); } return ( diff --git a/client/src/ws.ts b/client/src/ws.ts index 2afbe62..c48f2fd 100644 --- a/client/src/ws.ts +++ b/client/src/ws.ts @@ -1,5 +1,7 @@ import { wantsState, wsState, userState, offersState, acpOffersState } from './store' +import * as toast from './toast'; + const SOCKET_URL = `${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`; export default function createSocket(dispatch) { @@ -155,6 +157,7 @@ export default function createSocket(dispatch) { sendWantRm, sendOffers, + sendWants, sendAcpOffers, sendAcpOfferStatusSet,