Selaa lähdekoodia

fix latest event id (#5789)

Robert Brennan 1 vuosi sitten
vanhempi
sitoutus
d4e670a3e7
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      frontend/src/context/ws-client-provider.tsx

+ 6 - 0
frontend/src/context/ws-client-provider.tsx

@@ -79,6 +79,12 @@ export function WsClientProvider({
 
   function handleDisconnect() {
     setStatus(WsClientProviderStatus.DISCONNECTED);
+    const sio = sioRef.current;
+    if (!sio) {
+      return;
+    }
+    sio.io.opts.query = sio.io.opts.query || {};
+    sio.io.opts.query.latest_event_id = lastEventRef.current?.id;
   }
 
   function handleError() {