소스 검색

fix latest event id (#5789)

Robert Brennan 1 년 전
부모
커밋
d4e670a3e7
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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() {