fix: widget error
This commit is contained in:
@@ -46,7 +46,6 @@ import {
|
|||||||
import { getLocalAuthData, isElectronContext } from "@/utils";
|
import { getLocalAuthData, isElectronContext } from "@/utils";
|
||||||
import chatMessageHandler from "./chat.handler";
|
import chatMessageHandler from "./chat.handler";
|
||||||
import { shallowEqual } from "react-redux";
|
import { shallowEqual } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
|
||||||
|
|
||||||
const getQueryString = (params: { [key: string]: string }) => {
|
const getQueryString = (params: { [key: string]: string }) => {
|
||||||
const sp = new URLSearchParams();
|
const sp = new URLSearchParams();
|
||||||
@@ -69,7 +68,6 @@ export default function useStreaming() {
|
|||||||
const readUsers = useAppSelector((store) => store.footprint.readUsers, shallowEqual);
|
const readUsers = useAppSelector((store) => store.footprint.readUsers, shallowEqual);
|
||||||
const readChannels = useAppSelector((store) => store.footprint.readChannels, shallowEqual);
|
const readChannels = useAppSelector((store) => store.footprint.readChannels, shallowEqual);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { pathname } = useLocation();
|
|
||||||
const loginUid = user?.uid || 0;
|
const loginUid = user?.uid || 0;
|
||||||
|
|
||||||
const keepAlive = (timeout?: number) => {
|
const keepAlive = (timeout?: number) => {
|
||||||
@@ -454,12 +452,11 @@ export default function useStreaming() {
|
|||||||
// const timeSpan = 60;
|
// const timeSpan = 60;
|
||||||
const timeSpan = 24 * 60 * 60;
|
const timeSpan = 24 * 60 * 60;
|
||||||
// const timeSpan = 5;
|
// const timeSpan = 5;
|
||||||
const canReconnect = !guest && (elapsedTime > timeSpan || !SSE) && pathname !== "/login";
|
const canReconnect = !guest && (elapsedTime > timeSpan || !SSE);
|
||||||
// const canReconnect = (elapsedTime > timeSpan || !SSE) && pathname !== "/login";
|
// const canReconnect = (elapsedTime > timeSpan || !SSE) && pathname !== "/login";
|
||||||
console.info(
|
console.info(
|
||||||
"debug SSE: visibility changed elapsedTime",
|
"debug SSE: visibility changed elapsedTime",
|
||||||
elapsedTime,
|
elapsedTime,
|
||||||
pathname,
|
|
||||||
hiddenTime,
|
hiddenTime,
|
||||||
canReconnect,
|
canReconnect,
|
||||||
!SSE,
|
!SSE,
|
||||||
|
|||||||
Reference in New Issue
Block a user