mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 09:48:10 -05:00
patching up Live
This commit is contained in:
@@ -54,7 +54,6 @@ function CallPlayer(props) {
|
|||||||
const stickyRef = useRef(); // lets us get the Y Scroll offset for the Call List
|
const stickyRef = useRef(); // lets us get the Y Scroll offset for the Call List
|
||||||
const positionRef = useRef(); // lets us get the Y Scroll offset for the Call List
|
const positionRef = useRef(); // lets us get the Y Scroll offset for the Call List
|
||||||
const shouldPlayAddCallRef = useRef(); // we need to do this to make the current value of isPlaying available in the socket message callback
|
const shouldPlayAddCallRef = useRef(); // we need to do this to make the current value of isPlaying available in the socket message callback
|
||||||
const live = useSelector((state) => state.callPlayer.live);
|
|
||||||
shouldPlayAddCallRef.current = (!isPlaying && autoPlay) ? true : false;
|
shouldPlayAddCallRef.current = (!isPlaying && autoPlay) ? true : false;
|
||||||
|
|
||||||
let currentCallId = false;
|
let currentCallId = false;
|
||||||
@@ -96,7 +95,7 @@ function CallPlayer(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!live && loadNewerInView && callsData && (callsData.ids.length > 0)) {
|
if (loadNewerInView && callsData && (callsData.ids.length > 0)) {
|
||||||
handleNewer();
|
handleNewer();
|
||||||
}
|
}
|
||||||
}, [loadNewerInView]);
|
}, [loadNewerInView]);
|
||||||
|
|||||||
@@ -298,12 +298,6 @@ useLayoutEffect(() => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
socket.on('connect', () => {
|
socket.on('connect', () => {
|
||||||
console.log("Socket Connect");
|
console.log("Socket Connect");
|
||||||
setLive( (live) => {
|
|
||||||
if (live) {
|
|
||||||
//startSocket();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
setIsConnected(true);
|
setIsConnected(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -314,11 +308,7 @@ useLayoutEffect(() => {
|
|||||||
|
|
||||||
socket.on('reconnect', (attempts) => {
|
socket.on('reconnect', (attempts) => {
|
||||||
console.log("Socket Reconnected after attempts: " + attempts); // true
|
console.log("Socket Reconnected after attempts: " + attempts); // true
|
||||||
setLive( (live) => {
|
setIsConnected(true);
|
||||||
if (live) {
|
|
||||||
//startSocket();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on("new message", handleSocketMessage);
|
socket.on("new message", handleSocketMessage);
|
||||||
@@ -332,10 +322,10 @@ useLayoutEffect(() => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(getCalls({}));
|
dispatch(getCalls({}));
|
||||||
if (live) {
|
if (live && isConnected) {
|
||||||
startSocket();
|
startSocket();
|
||||||
}
|
}
|
||||||
}, [shortName, filterGroupId, filterTalkgroups, filterType, filterDate, filterStarred])
|
}, [shortName, filterGroupId, filterTalkgroups, filterType, filterDate, filterStarred, isConnected])
|
||||||
|
|
||||||
|
|
||||||
// Update the Browser URI when any relevant values change
|
// Update the Browser URI when any relevant values change
|
||||||
|
|||||||
Reference in New Issue
Block a user